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
This commit is contained in:
Florian Müllner 2020-02-14 20:19:37 +01:00
parent 0d766dcf70
commit 8834088f3b

View File

@ -593,6 +593,13 @@ var UnlockDialog = GObject.registerClass({
(this._promptBox && this._promptBox.visible)) (this._promptBox && this._promptBox.visible))
return Clutter.EVENT_PROPAGATE; 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; let unichar = keyEvent.unicode_value;
this._showPrompt(); this._showPrompt();