Skip to content

Commit b0d117d

Browse files
committed
endSessionDialog.js: Don't close the dialog immediately when
selecting 'suspend' or 'hibernate'. This was preventing the session manager from responding with an inhibitor list and giving the user the option to ignore them and 'force' the action, as happens correctly with other options. It was also breaking the lifecycle of this dialog and disable it from showing again. Also fix an issue with the inhibitor list not clearing existing items when receiving an updated list from the session manager. Fixes linuxmint/cinnamon-session#193.
1 parent 09d280a commit b0d117d

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

js/ui/endSessionDialog.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,20 +155,14 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
155155
if (canSuspend) {
156156
this.addButton({
157157
label: _("Suspend"),
158-
action: () => {
159-
this._dialogProxy.SuspendRemote();
160-
this.close();
161-
},
158+
action: this._dialogProxy.SuspendRemote.bind(this._dialogProxy),
162159
});
163160
}
164161

165162
if (canHibernate) {
166163
this.addButton({
167164
label: _("Hibernate"),
168-
action: () => {
169-
this._dialogProxy.HibernateRemote();
170-
this.close();
171-
}
165+
action: this._dialogProxy.HibernateRemote.bind(this._dialogProxy),
172166
});
173167
}
174168

@@ -278,6 +272,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
278272
_presentInhibitorInfo(inhibitorInfos) {
279273
this._removeDelayTimer();
280274
this.clearButtons();
275+
this._applicationsSection.list.destroy_all_children();
281276
this._messageDialogContent.description = null;
282277

283278
const infos = inhibitorInfos;

0 commit comments

Comments
 (0)