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



commit 0a54118a52d5186b0b6c2e190522693f9b371a78
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 | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)
---
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index cb2a69ef8..dbf0525ec 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -937,6 +937,8 @@ var LoginDialog = GObject.registerClass({
     }
 
     _loginScreenSessionDeactivated() {
+        this._stopTimedLogin();
+
         if (this._greeter) {
             this._greeter.run_dispose();
             this._greeter = null;
@@ -978,6 +980,8 @@ var LoginDialog = GObject.registerClass({
     }
 
     _onSessionOpened(client, serviceName) {
+        this._stopTimedLogin();
+
         this._authPrompt.finish(() => { this._startSession(serviceName); });
     }
 
@@ -1014,21 +1018,26 @@ var LoginDialog = GObject.registerClass({
         return hold;
     }
 
-    _startTimedLogin(userName, delay) {
-        let firstRun = true;
-
-        // Cancel execution of old batch
+    _stopTimedLogin() {
         if (this._timedLoginBatch) {
             this._timedLoginBatch.cancel();
             this._timedLoginBatch = null;
-            firstRun = false;
-        }
+       }
 
-        // Reset previous idle-timeout
         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._stopTimedLogin();
+            firstRun = false;
+        }
 
         let loginItem = null;
         let animationTime;


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