screenShield: defer deactivation until all messages are shown

Right now when a user types their password to unlock their session
we end up getting an unlock signal from GDM right away.  We then
proceed to deactivate the screensaver before the user has a chance
to read his messages.

This commit makes sure we clear out the message queue before processing
the deactivation request.

https://bugzilla.gnome.org/show_bug.cgi?id=704347
This commit is contained in:
Ray Strode 2013-07-18 08:58:58 -04:00
parent 55a04bbf2b
commit ded99b9a09
2 changed files with 20 additions and 0 deletions

View File

@ -1121,6 +1121,12 @@ const ScreenShield = new Lang.Class({
},
deactivate: function(animate) {
this._dialog.finish(Lang.bind(this, function() {
this._finishDeactivate(animate);
}));
},
_finishDeactivate: function(animate) {
this._hideLockScreen(animate, 0);
if (this._hasLockScreen)

View File

@ -281,4 +281,18 @@ const UnlockDialog = new Lang.Class({
addCharacter: function(unichar) {
this._promptEntry.clutter_text.insert_unichar(unichar);
},
finish: function(onComplete) {
if (!this._userVerifier.hasPendingMessages) {
onComplete();
return;
}
let signalId = this._userVerifier.connect('no-more-messages',
Lang.bind(this, function() {
this._userVerifier.disconnect(signalId);
onComplete();
}));
}
});