diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js index d14d9d3ac..316bc2ad1 100644 --- a/js/ui/components/polkitAgent.js +++ b/js/ui/components/polkitAgent.js @@ -40,6 +40,10 @@ var AuthenticationDialog = new Lang.Class({ this.userNames = userNames; this._wasDismissed = false; + this._sessionUpdatedId = Main.sessionMode.connect('updated', () => { + this._group.visible = !Main.sessionMode.isLocked; + }); + let icon = new Gio.ThemedIcon({ name: 'dialog-password-symbolic' }); let title = _("Authentication Required"); @@ -194,6 +198,12 @@ var AuthenticationDialog = new Lang.Class({ this._session.initiate(); }, + close(timestamp) { + this.parent(timestamp); + + Main.sessionMode.disconnect(this._sessionUpdatedId); + }, + _ensureOpen() { // NOTE: ModalDialog.open() is safe to call if the dialog is // already open - it just returns true without side-effects