[gnome-shell/wip/timed-login-fix: 3/4] loginDialog: stop timed login when VT switching away



commit 3ebe00178e05fd7fadf80147faf2f0d79ba31974
Author: Ray Strode <rstrode redhat com>
Date:   Wed Feb 6 16:07:27 2019 -0500

    loginDialog: stop timed login when VT switching away
    
    At the moment, the timed login timer continues along even
    after the user logs in.  That's wrong, the login screen should
    be dormant when the VT isn't active.
    
    This commit makes sure we turn off timed login when the user
    is about to be logged in and when the user switches VTs.

 js/gdm/loginDialog.js | 28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)
---
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 682448ca6..f09569085 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -940,6 +940,8 @@ var LoginDialog = new Lang.Class({
     },
 
     _loginScreenSessionDeactivated() {
+        this._stopTimedLogin();
+
         if (this._greeter) {
             this._greeter.run_dispose();
             this._greeter = null;
@@ -981,6 +983,8 @@ var LoginDialog = new Lang.Class({
     },
 
     _onSessionOpened(client, serviceName) {
+        this._stopTimedLogin();
+
         this._authPrompt.finish(() => { this._startSession(serviceName); });
     },
 
@@ -1017,22 +1021,30 @@ var LoginDialog = new Lang.Class({
         return hold;
     },
 
+    _stopTimedLogin() {
+        if (!this._timedLoginBatch)
+            return;
+
+        this._timedLoginBatch.cancel();
+        this._timedLoginBatch = null;
+
+        this._timedLoginBatch = null;
+
+        if (this._timedLoginIdleTimeOutId) {
+            GLib.source_remove(this._timedLoginIdleTimeOutId);
+            this._timedLoginIdleTimeOutId = 0;
+        }
+    },
+
     _startTimedLogin(userName, delay) {
         let firstRun = true;
 
         // Cancel execution of old batch
         if (this._timedLoginBatch) {
-            this._timedLoginBatch.cancel();
-            this._timedLoginBatch = null;
+            this._stopTimedLogin();
             firstRun = false;
         }
 
-        // Reset previous idle-timeout
-        if (this._timedLoginIdleTimeOutId) {
-            GLib.source_remove(this._timedLoginIdleTimeOutId);
-            this._timedLoginIdleTimeOutId = 0;
-        }
-
         let loginItem = null;
         let animationTime;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]