[gnome-shell/gnome-3-36] authPrompt: Grab key focus when making entry sensitive
- From: verdre <jonasd src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-36] authPrompt: Grab key focus when making entry sensitive
- Date: Tue, 28 Apr 2020 16:45:37 +0000 (UTC)
commit fb7e70d5625a2ae7bc2d7dfaa771a6cfa4d9f4a8
Author: Jonas Dreßler <verdre v0yd nl>
Date: Wed Apr 22 15:27:54 2020 +0000
authPrompt: Grab key focus when making entry sensitive
We currently let the entry of the autoPrompt grab the key focus inside
setQuestion(), which is called from _onAskQuestion(), which is the
callback of the "ask-question" signal.
It seems that the "ask-question" signal isn't emitted again right after
the password-check failed, but a few seconds after that. Since we get
the "verification-failed" signal earlier than "ask-question" (right
after we know the check failed) and we also get a hint whether the entry
should be usable again with the canRetry argument, we can also grab key
focus to in the same step.
So do that by grabbing key focus when making the entry sensitive.
Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2655
(cherry picked from commit 8d139bbd95a5d62e0ba20b711a10a8b669cb9e9d)
js/gdm/authPrompt.js | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index c26b1bcad5..29170c555a 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -424,7 +424,13 @@ var AuthPrompt = GObject.registerClass({
}
updateSensitivity(sensitive) {
+ if (this._entry.reactive === sensitive)
+ return;
+
this._entry.reactive = sensitive;
+
+ if (sensitive)
+ this._entry.grab_key_focus();
}
vfunc_hide() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]