diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2022-11-11 13:13:41 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2022-12-06 10:44:41 +0100 |
commit | 9f5706403224d7108292ac8aaa63798ab5d70fc7 (patch) | |
tree | f0523c0f8897672190a91a12d480218eae413e3f | |
parent | afd33f06780185dfdd1ed4bdd79883031a7e43d5 (diff) | |
download | gnome-shell-wip/carlosg/unfocused-purpose-43.tar.gz |
status/keyboard: Ignore purpose hint changes while keymap switcher is shownwip/carlosg/unfocused-purpose-43
If we are getting purpose hint changes while the language switcher is popped
up, this likely means the purpose hint was actually triggered by the key
focus change induced by the language switcher popping up.
In this case, we on one hand would like to preserve the state that applied
before thise focus change, and on the other we very much want to avoid the
keymap change that would forget about the keys being pressed.
(Cherry-picked from commit 2e8e1fe8fcd5af37dff7efccc17269366a2001b2)
-rw-r--r-- | js/ui/status/keyboard.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js index 82706c038..b47375d64 100644 --- a/js/ui/status/keyboard.js +++ b/js/ui/status/keyboard.js @@ -411,9 +411,14 @@ var InputSourceManager = class extends Signals.EventEmitter { return; } - let popup = new InputSourcePopup(this._mruSources, this._keybindingAction, this._keybindingActionBackward); - if (!popup.show(binding.is_reversed(), binding.get_name(), binding.get_mask())) - popup.fadeAndDestroy(); + this._switcherPopup = new InputSourcePopup( + this._mruSources, this._keybindingAction, this._keybindingActionBackward); + this._switcherPopup.connect('destroy', () => { + this._switcherPopup = null; + }); + if (!this._switcherPopup.show( + binding.is_reversed(), binding.get_name(), binding.get_mask())) + this._switcherPopup.fadeAndDestroy(); } _keyboardOptionsChanged() { @@ -675,6 +680,10 @@ var InputSourceManager = class extends Signals.EventEmitter { } _ibusSetContentType(im, purpose, _hints) { + // Avoid purpose changes while the switcher popup is shown, likely due to + // the focus change caused by the switcher popup causing this purpose change. + if (this._switcherPopup) + return; if (purpose == IBus.InputPurpose.PASSWORD) { if (Object.keys(this._inputSources).length == Object.keys(this._ibusSources).length) return; |