From 7dd326f0908558fcc9cc8e6e94533a36ba8d3907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 11 Sep 2018 18:00:22 +0200 Subject: [PATCH] keyboard: Make items in language menu unfocusable The menu grabs the key focus when opened, which takes focus away from whichever actor triggered the keyboard. And as the menu doesn't have any text entries, the keyboard is popped down as a result. Prevent this by making the menu items unfocusable, so the keyboard focus just stays where it is. Considering that the menu is part of the on-screen keyboard itself, not being keyboard-navigatable isn't a big deal here. https://gitlab.gnome.org/GNOME/gnome-shell/issues/171 --- js/ui/keyboard.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index c8eb29719..bfddcdec9 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -189,16 +189,20 @@ var LanguageSelectionPopup = class extends PopupMenu.PopupMenu { let inputSourceManager = InputSourceManager.getInputSourceManager(); let inputSources = inputSourceManager.inputSources; + let item; for (let i in inputSources) { let is = inputSources[i]; - this.addAction(is.displayName, () => { + item = this.addAction(is.displayName, () => { inputSourceManager.activateInputSource(is, true); }); + item.actor.can_focus = false; } this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); - this.addSettingsAction(_("Region & Language Settings"), 'gnome-region-panel.desktop'); + item = this.addSettingsAction(_("Region & Language Settings"), 'gnome-region-panel.desktop'); + item.actor.can_focus = false; + this._capturedEventId = 0; this._unmapId = actor.connect('notify::mapped', () => {