summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorverdre <gitlab@v0yd.nl>2018-04-17 14:51:20 +0200
committerverdre <gitlab@v0yd.nl>2018-04-19 09:08:45 +0200
commit522a5fe480c45fb35dbe7fe7e2fc48560ad608b5 (patch)
tree3bad4b87aa9fdc44395c93b31534e1aadfd53f93
parentb1239b1257fe2990f19b7d6eb31af10fd3c1c26a (diff)
downloadgnome-shell-522a5fe480c45fb35dbe7fe7e2fc48560ad608b5.tar.gz
loginDialog: Ensure old timed login timeout is removed before starting a new one
Normally, we give the user a 5 second grace period of inactivity before starting a timed login operation. Unfortunately, that grace period timeout isn't properly removed if the timed login operation is restarted during the grace period. That means the timeout handler can inadvertently get called multiple times leading to the grace period duration getting subtracted from the total animation time more than once. This commit ensures we only ever have one grace period timeout scheduled at a time.
-rw-r--r--js/gdm/loginDialog.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index dc5eaa235..017947689 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -1010,6 +1010,7 @@ var LoginDialog = new Lang.Class({
this._timedLoginIdleTimeOutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, _TIMED_LOGIN_IDLE_THRESHOLD,
() => {
this._timedLoginAnimationTime -= _TIMED_LOGIN_IDLE_THRESHOLD;
+ this._timedLoginIdleTimeOutId = 0;
hold.release();
return GLib.SOURCE_REMOVE;
});
@@ -1024,6 +1025,12 @@ var LoginDialog = new Lang.Class({
this._timedLoginBatch = null;
}
+ // Reset previous idle-timeout
+ if (this._timedLoginIdleTimeOutId) {
+ GLib.source_remove(this._timedLoginIdleTimeOutId);
+ this._timedLoginIdleTimeOutId = 0;
+ }
+
this._timedLoginItem = null;
this._timedLoginDelay = delay;
this._timedLoginAnimationTime = delay;