Fix Game Bar keep clearing focus even when not playing

This commit is contained in:
redphx 2024-10-19 16:54:21 +07:00
parent 03efa528c8
commit bbaea5f629

View File

@ -81,14 +81,11 @@ export class GameBar {
// Enable/disable Game Bar when playing/pausing // Enable/disable Game Bar when playing/pausing
getPref(PrefKey.GAME_BAR_POSITION) !== 'off' && window.addEventListener(BxEvent.XCLOUD_POLLING_MODE_CHANGED, ((e: Event) => { getPref(PrefKey.GAME_BAR_POSITION) !== 'off' && window.addEventListener(BxEvent.XCLOUD_POLLING_MODE_CHANGED, ((e: Event) => {
if (!STATES.isPlaying) {
this.disable();
return;
}
// Toggle Game bar // Toggle Game bar
const mode = (e as any).mode; if (STATES.isPlaying) {
mode !== 'none' ? this.disable() : this.enable(); const mode = (e as any).mode;
mode !== 'none' ? this.disable() : this.enable();
}
}).bind(this)); }).bind(this));
} }
@ -124,10 +121,6 @@ export class GameBar {
hideBar() { hideBar() {
this.clearHideTimeout(); this.clearHideTimeout();
// Stop focusing Game Bar
clearFocus();
this.$container.classList.replace('bx-show', 'bx-hide'); this.$container.classList.replace('bx-show', 'bx-hide');
} }