[gnome-shell/gbsneto/new-lock-screen-part2: 31/32] screenShield: Rework key focus management
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/new-lock-screen-part2: 31/32] screenShield: Rework key focus management
- Date: Thu, 12 Dec 2019 21:57:57 +0000 (UTC)
commit 639e18d9f5c15e64b4595faad7a206c7249dbc40
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Mon Dec 2 12:35:00 2019 -0300
screenShield: Rework key focus management
Instead of always grabbing key focus for the screen lock
group, do that for the unlock dialog itself.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/872
js/ui/screenShield.js | 17 ++++++++++-------
js/ui/unlockDialog.js | 1 +
2 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index 9f66ad0b72..fb8cfc3066 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -55,11 +55,14 @@ var ScreenShield = class {
});
Main.ctrlAltTabManager.addGroup(this._lockScreenGroup, _("Lock"), 'changes-prevent-symbolic');
- this._lockDialogGroup = new St.Widget({ x_expand: true,
- y_expand: true,
- reactive: true,
- pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }),
- name: 'lockDialogGroup' });
+ this._lockDialogGroup = new St.Widget({
+ x_expand: true,
+ y_expand: true,
+ reactive: true,
+ can_focus: true,
+ pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }),
+ name: 'lockDialogGroup',
+ });
this.actor.add_actor(this._lockScreenGroup);
this.actor.add_actor(this._lockDialogGroup);
@@ -148,7 +151,7 @@ var ScreenShield = class {
// LoginDialog.cancel() will grab the key focus
// on its own, so ensure it stays on lock screen
// instead
- this._lockScreenGroup.grab_key_focus();
+ this._dialog.grab_key_focus();
}
}
@@ -407,7 +410,7 @@ var ScreenShield = class {
this._lockScreenShown({ fadeToBlack, animateFade: false });
}
- this._lockScreenGroup.grab_key_focus();
+ this._dialog.grab_key_focus();
}
_lockScreenShown(params) {
diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js
index 3fff8c4010..c0711240f5 100644
--- a/js/ui/unlockDialog.js
+++ b/js/ui/unlockDialog.js
@@ -397,6 +397,7 @@ var UnlockDialog = GObject.registerClass({
accessible_role: Atk.Role.WINDOW,
style_class: 'login-dialog',
visible: false,
+ can_focus: true,
reactive: true,
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]