unlockDialog: ignore resets after success

GDM sends a reset signal after verification succeeds
so that a user-switched login screen can prepare for
the next time it's going to be used.

The unlock screen treats resets as failures, though.
This means, on success, we're emitting "failed" and
clearing any last second messages.

This commit changes the unlock code to ignore resets from
GDM after successful verification.

https://bugzilla.gnome.org/show_bug.cgi?id=694688
This commit is contained in:
Ray Strode 2013-03-18 01:14:44 -04:00
parent e9584cfcab
commit f72f501931

View File

@ -47,6 +47,7 @@ const UnlockDialog = new Lang.Class({
this._greeterClient = new Gdm.Client();
this._userVerifier = new GdmUtil.ShellUserVerifier(this._greeterClient, { reauthenticationOnly: true });
this._userVerified = false;
this._userVerifier.connect('ask-question', Lang.bind(this, this._onAskQuestion));
this._userVerifier.connect('show-message', Lang.bind(this, this._showMessage));
@ -250,18 +251,22 @@ const UnlockDialog = new Lang.Class({
},
_onVerificationComplete: function() {
this._userVerified = true;
this._userVerifier.clear();
this.emit('unlocked');
},
_onReset: function() {
this._userVerifier.clear();
this.emit('failed');
if (!this._userVerified) {
this._userVerifier.clear();
this.emit('failed');
}
},
_onVerificationFailed: function() {
this._currentQuery = null;
this._firstQuestion = true;
this._userVerified = false;
this._promptEntry.text = '';
this._promptEntry.clutter_text.set_password_char('\u25cf');