diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js index 4ea4efba4..f03af35fc 100644 --- a/js/ui/components/polkitAgent.js +++ b/js/ui/components/polkitAgent.js @@ -42,6 +42,8 @@ var AuthenticationDialog = new Lang.Class({ this._group.visible = !Main.sessionMode.isLocked; }); + this.connect('closed', this._onDialogClosed.bind(this)); + let icon = new Gio.ThemedIcon({ name: 'dialog-password-symbolic' }); let title = _("Authentication Required"); @@ -176,14 +178,6 @@ var AuthenticationDialog = new Lang.Class({ this._session.initiate(); }, - close(timestamp) { - this.parent(timestamp); - - if (this._sessionUpdatedId) - Main.sessionMode.disconnect(this._sessionUpdatedId); - this._sessionUpdatedId = 0; - }, - _ensureOpen() { // NOTE: ModalDialog.open() is safe to call if the dialog is // already open - it just returns true without side-effects @@ -332,6 +326,12 @@ var AuthenticationDialog = new Lang.Class({ this.close(global.get_current_time()); this._emitDone(true); }, + + _onDialogClosed() { + if (this._sessionUpdatedId) + Main.sessionMode.disconnect(this._sessionUpdatedId); + this._sessionUpdatedId = 0; + }, }); Signals.addSignalMethods(AuthenticationDialog.prototype);