[gnome-shell] unlock: Don't show prompt on shifty key presses



commit 8834088f3b43c935cb725adf9674da8ebb31ddbf
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Feb 14 20:19:37 2020 +0100

    unlock: Don't show prompt on shifty key presses
    
    Shift, caps-lock and friends change the capitalization of following
    key presses. It is unexpected for those keys to have side-effects,
    so don't switch to the prompt when they are pressed.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/issues/2215

 js/ui/unlockDialog.js | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js
index 7a6c936121..70968ad4d8 100644
--- a/js/ui/unlockDialog.js
+++ b/js/ui/unlockDialog.js
@@ -593,6 +593,13 @@ var UnlockDialog = GObject.registerClass({
             (this._promptBox && this._promptBox.visible))
             return Clutter.EVENT_PROPAGATE;
 
+        const { keyval } = keyEvent;
+        if (keyval === Clutter.KEY_Shift_L ||
+            keyval === Clutter.KEY_Shift_R ||
+            keyval === Clutter.KEY_Shift_Lock ||
+            keyval === Clutter.KEY_Caps_Lock)
+            return Clutter.EVENT_PROPAGATE;
+
         let unichar = keyEvent.unicode_value;
 
         this._showPrompt();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]