[gnome-shell] loginDialog: Restrict grabbing of focus while timed login is running
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] loginDialog: Restrict grabbing of focus while timed login is running
- Date: Thu, 19 Apr 2018 17:24:05 +0000 (UTC)
commit 5cc6fef6892f42f0413f1411213687baa2e1e2f8
Author: verdre <gitlab v0yd nl>
Date: Tue Apr 17 15:04:04 2018 +0200
loginDialog: Restrict grabbing of focus while timed login is running
Make sure the focus isn't grabbed right after user interaction starts a
new timed login. Only grab it after the idle timeout is done and on the
first run instead.
js/gdm/loginDialog.js | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 017947689..eb8465c59 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -990,11 +990,6 @@ var LoginDialog = new Lang.Class({
return hold;
},
- _showTimedLoginAnimation() {
- this._timedLoginItem.actor.grab_key_focus();
- return this._timedLoginItem.showTimedLoginIndicator(this._timedLoginAnimationTime);
- },
-
_blockTimedLoginUntilIdle() {
// This blocks timed login from starting until a few
// seconds after the user stops interacting with the
@@ -1019,10 +1014,13 @@ var LoginDialog = new Lang.Class({
},
_startTimedLogin(userName, delay) {
+ let firstRun = true;
+
// Cancel execution of old batch
if (this._timedLoginBatch) {
this._timedLoginBatch.cancel();
this._timedLoginBatch = null;
+ firstRun = false;
}
// Reset previous idle-timeout
@@ -1054,10 +1052,13 @@ var LoginDialog = new Lang.Class({
this._blockTimedLoginUntilIdle,
() => {
- this._userList.scrollToItem(this._timedLoginItem);
+ if (this._timedLoginDelay > _TIMED_LOGIN_IDLE_THRESHOLD || firstRun) {
+ this._userList.scrollToItem(this._timedLoginItem);
+ this._timedLoginItem.actor.grab_key_focus();
+ }
},
- this._showTimedLoginAnimation,
+ () => this._timedLoginItem.showTimedLoginIndicator(this._timedLoginAnimationTime),
() => {
this._timedLoginBatch = null;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]