Compare commits

...

7 Commits

Author SHA1 Message Date
Ray Strode
0a4be01ab1 loginDialog: hide user list when starting timed login
If the timeout fires and we're starting timed login, we
should hide the user list, in case the login process
needs to show the user any messages on the auth prompt.
2019-02-07 12:57:48 -05:00
Ray Strode
a1f117e520 loginDialog: hide authprompt when VT switching away
The authprompt is no longer useful if the user isn't
on the VT, and it's not what the user is going to
ultimately see when they come back (they'll see the
user list), so we should hide it.

Fixes a bug where it briefly blinks in view on
VT switch.
2019-02-07 12:57:28 -05:00
Ray Strode
4cd5c2e60f loginDialog: reset auth prompt on vt switch before fade in
At the moment, if a user switches to the login screen vt,
the login screen fades in whatever was on screen prior, and
then does a reset.

It makes more sense to reset first, so we fade in what the
user is going to interact with instead of what they interacted
with before.
2019-02-07 12:56:29 -05:00
Ray Strode
46fcea566d loginDialog: hide timed login indicator when timed login is stopped
At the moment the login screen doesn't hide the timed login indicator,
once the user is logged in with a timed login operation.

This commit makes sure the timed login indicator gets hidden any time
the timed login operation completes or is canceled.
2019-02-07 12:54:54 -05:00
Ray Strode
0a54118a52 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.
2019-02-07 12:53:54 -05:00
Ray Strode
3454a39590 loginDialog: disconnect greeter when switching away VTs
At the moment the greeter stays connected to GDM even after the
user logs in.  That stale connection can lead to bookkeeping
confusion later on.

This commit makes sure we disconnect the greeter connection any
time the user logs in or otherwise switches VTs.

This commit also make sure we do a full reset when VT switching
back later, so the greeter connection can get re-setup.
2019-02-07 12:52:30 -05:00
Ray Strode
98a437c38d loginDialog: only reactivate dialog when session goes active
At the moment, we reactivate the login dialog any time any
property on the logind session proxy changes and the VT
is active.

That means we sometimes reactivate the login screen even
when the user isn't switching VTs to the login screen.

This commit ensures that we only check if the session is
active when the session activeness changes, and not when other
logind session properties change.
2019-02-07 12:51:08 -05:00

View File

@ -917,9 +917,7 @@ var LoginDialog = GObject.registerClass({
}
_loginScreenSessionActivated() {
if (this.opacity == 255 && this._authPrompt.verificationStatus == AuthPrompt.AuthPromptStatus.NOT_VERIFYING)
return;
this._authPrompt.reset();
Tweener.addTween(this,
{ opacity: 255,
time: _FADE_ANIMATION_TIME,
@ -932,20 +930,32 @@ var LoginDialog = GObject.registerClass({
children[i].opacity = this.opacity;
}
},
onUpdateScope: this,
onComplete() {
if (this._authPrompt.verificationStatus != AuthPrompt.AuthPromptStatus.NOT_VERIFYING)
this._authPrompt.reset();
},
onCompleteScope: this });
onUpdateScope: this });
}
_loginScreenSessionDeactivated() {
this._stopTimedLogin();
if (this._greeter) {
this._greeter.run_dispose();
this._greeter = null;
}
this._authPrompt.hide();
this.actor.opacity = 0;
}
_gotGreeterSessionProxy(proxy) {
this._greeterSessionProxy = proxy;
this._greeterSessionProxyChangedId =
proxy.connect('g-properties-changed', () => {
proxy.connect('g-properties-changed', (proxy, properties) => {
if (!('Active' in properties.deep_unpack()))
return;
if (proxy.Active)
this._loginScreenSessionActivated();
else
this._loginScreenSessionDeactivated();
});
}
@ -970,6 +980,8 @@ var LoginDialog = GObject.registerClass({
}
_onSessionOpened(client, serviceName) {
this._stopTimedLogin();
this._authPrompt.finish(() => { this._startSession(serviceName); });
}
@ -1006,36 +1018,36 @@ 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;
let tasks = [() => this._waitForItemForUser(userName),
() => {
// If we're just starting out, start on the right item.
loginItem = this._userList.getItemFromUserName(userName);
// If there is an animation running on the item, reset it.
loginItem.hideTimedLoginIndicator();
},
() => {
// If we're just starting out, start on the right item.
if (!this._userManager.is_loaded) {
this._userList.jumpToItem(loginItem);
}
@ -1071,12 +1083,20 @@ var LoginDialog = GObject.registerClass({
() => {
this._timedLoginBatch = null;
this._hideUserList();
this._greeter.call_begin_auto_login_sync(userName, null);
}];
this._timedLoginBatch = new Batch.ConsecutiveBatch(this, tasks);
return this._timedLoginBatch.run();
let hold = this._timedLoginBatch.run();
hold.connect('release', () => {
if (loginItem)
loginItem.hideTimedLoginIndicator();
});
return hold;
}
_onTimedLoginRequested(client, userName, seconds) {