[gnome-shell/gbsneto/new-lock-screen-part2: 26/43] screenShield: Activate dialog when necessary
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/new-lock-screen-part2: 26/43] screenShield: Activate dialog when necessary
- Date: Thu, 30 Jan 2020 15:21:05 +0000 (UTC)
commit 323de55b5981d8ce540196ec8b560944aaa0a87f
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Jan 30 11:44:43 2020 -0300
screenShield: Activate dialog when necessary
Activating a dialog is slightly different from opening it; the
former is about showing the user authentication widgetry, while
the latter is about creating it and pre-allocating the necessary
resources.
Activate the screen shield dialog when necessary.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/872
js/gdm/loginDialog.js | 9 +++++++--
js/ui/screenShield.js | 5 +++--
js/ui/unlockDialog.js | 4 ++++
3 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 503245a574..519f97f790 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -1228,13 +1228,18 @@ var LoginDialog = GObject.registerClass({
return GLib.SOURCE_REMOVE;
}
+ activate() {
+ this._userList.grab_key_focus();
+ this.show();
+ }
+
open() {
Main.ctrlAltTabManager.addGroup(this,
_("Login Window"),
'dialog-password-symbolic',
{ sortGroup: CtrlAltTab.SortGroup.MIDDLE });
- this._userList.grab_key_focus();
- this.show();
+ this.activate();
+
this.opacity = 0;
Main.pushModal(this, { actionMode: Shell.ActionMode.LOGIN_SCREEN });
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index 5908ff5477..b2b7c8a953 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -159,8 +159,8 @@ var ScreenShield = class {
_liftShield() {
if (this._isLocked) {
- if (this._ensureUnlockDialog(true /* allowCancel */))
- this._hideLockScreen(true /* animate */);
+ this._ensureUnlockDialog(true /* allowCancel */);
+ this._dialog.activate();
} else {
this.deactivate(true /* animate */);
}
@@ -437,6 +437,7 @@ var ScreenShield = class {
}
this._dialog.allowCancel = allowCancel;
+ this._dialog.grab_key_focus();
return true;
}
diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js
index 697c96bf79..832a1d64ad 100644
--- a/js/ui/unlockDialog.js
+++ b/js/ui/unlockDialog.js
@@ -521,6 +521,10 @@ var UnlockDialog = GObject.registerClass({
return true;
}
+ activate() {
+ this._showPrompt();
+ }
+
popModal(timestamp) {
if (this._isModal) {
Main.popModal(this, timestamp);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]