From ab24ee7a7e0177b8780f40252784a75ff7db977f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 19 Feb 2020 17:32:22 +0100 Subject: [PATCH] authPrompt: Don't focus hidden cancelButton The button is hidden on the lock screen, so it shouldn't be allowed to activate it, be it via click or keyboard. The latter is still possible by keynaving to the button and hitting space/enter. Fix that by making the button unfocusable when we make it unreactive. https://gitlab.gnome.org/GNOME/gnome-shell/issues/2210 --- js/gdm/authPrompt.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js index 0cb2462a0..bab6d5dee 100644 --- a/js/gdm/authPrompt.js +++ b/js/gdm/authPrompt.js @@ -134,7 +134,7 @@ var AuthPrompt = GObject.registerClass({ style_class: 'modal-dialog-button button cancel-button', button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE, reactive: this._hasCancelButton, - can_focus: true, + can_focus: this._hasCancelButton, x_align: Clutter.ActorAlign.START, y_align: Clutter.ActorAlign.CENTER, child: new St.Icon({ icon_name: 'go-previous-symbolic' }), @@ -285,6 +285,7 @@ var AuthPrompt = GObject.registerClass({ this.setActorInDefaultButtonWell(null); this.verificationStatus = AuthPromptStatus.VERIFICATION_SUCCEEDED; this.cancelButton.reactive = false; + this.cancelButton.can_focus = false; } _onReset() { @@ -453,6 +454,7 @@ var AuthPrompt = GObject.registerClass({ let oldStatus = this.verificationStatus; this.verificationStatus = AuthPromptStatus.NOT_VERIFYING; this.cancelButton.reactive = this._hasCancelButton; + this.cancelButton.can_focus = this._hasCancelButton; this._preemptiveAnswer = null; if (this._userVerifier)