diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js index db64c688e..1c6719e49 100644 --- a/js/gdm/authPrompt.js +++ b/js/gdm/authPrompt.js @@ -420,6 +420,9 @@ const AuthPrompt = new Lang.Class({ this.stopSpinning(); this.setHint(null); + if (oldStatus == AuthPromptStatus.VERIFICATION_FAILED) + this.emit('failed'); + this.emit('reset'); }, @@ -460,6 +463,7 @@ const AuthPrompt = new Lang.Class({ cancel: function() { this.reset(); + this.emit('cancelled'); } }); Signals.addSignalMethods(AuthPrompt.prototype); diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js index 1fc55eb70..8f30d6e95 100644 --- a/js/ui/unlockDialog.js +++ b/js/ui/unlockDialog.js @@ -49,7 +49,8 @@ const UnlockDialog = new Lang.Class({ factor: 0.5 })); this._authPrompt = new AuthPrompt.AuthPrompt(new Gdm.Client(), AuthPrompt.AuthPromptMode.UNLOCK_ONLY); - this._authPrompt.connect('reset', Lang.bind(this, this._onReset)); + this._authPrompt.connect('failed', Lang.bind(this, this._fail)); + this._authPrompt.connect('cancelled', Lang.bind(this, this._fail)); this._authPrompt.setUser(this._user); this._authPrompt.setPasswordChar('\u25cf'); this._authPrompt.nextButton.label = _("Unlock"); @@ -92,15 +93,13 @@ const UnlockDialog = new Lang.Class({ } }, - _onReset: function() { + _fail: function() { this.emit('failed'); }, _escape: function() { - if (this.allowCancel) { + if (this.allowCancel) this._authPrompt.cancel(); - this.emit('failed'); - } }, _otherUserClicked: function(button, event) {