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.
This commit is contained in:
Ray Strode 2019-02-06 16:07:27 -05:00
parent 3454a39590
commit 0a54118a52

View File

@ -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,22 +1018,27 @@ var LoginDialog = GObject.registerClass({
return hold;
}
_stopTimedLogin() {
if (this._timedLoginBatch) {
this._timedLoginBatch.cancel();
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;