mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-26 09:23:04 +02:00
Fix Game Bar keep clearing focus even when not playing
This commit is contained in:
@ -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
|
||||||
|
if (STATES.isPlaying) {
|
||||||
const mode = (e as any).mode;
|
const mode = (e as any).mode;
|
||||||
mode !== 'none' ? this.disable() : this.enable();
|
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');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user