From c752682ab976c71ea8c886075b97cdd2df7bbc9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 11 Nov 2019 22:00:01 +0100 Subject: [PATCH] switcherPopup: Improve modifier-less keybinding navigation Commit c899453800f11 lifted the requirement of switcher keybindings to contain a modifier, however it is currently only possible to finish it by letting it time out. Improve that by also accepting space/enter key presses to confirm the selection immediately. https://gitlab.gnome.org/GNOME/gnome-shell/issues/1883 --- js/ui/switcherPopup.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/ui/switcherPopup.js b/js/ui/switcherPopup.js index c956eea43..30b380f64 100644 --- a/js/ui/switcherPopup.js +++ b/js/ui/switcherPopup.js @@ -180,6 +180,14 @@ var SwitcherPopup = GObject.registerClass({ if (keysym == Clutter.Escape || keysym == Clutter.Tab) this.fadeAndDestroy(); + // Allow to explicitly select the current item; this is particularly + // useful for no-modifier popups + if (keysym === Clutter.KEY_space || + keysym === Clutter.KEY_Return || + keysym === Clutter.KEY_KP_Enter || + keysym === Clutter.KEY_ISO_Enter) + this._finish(keyEvent.time); + return Clutter.EVENT_STOP; }