Skip to content

Commit

Permalink
main.js: Handle an end-session-dialog failure to show.
Browse files Browse the repository at this point in the history
If the end-session dialog is requested while the screensaver is
active, pushModal() will fail, as cinnamon-screensaver has a hard
keyboard and pointer grab.

Discard the dialog when this happens, to allow a successful prompt
later.

Fixes linuxmint/mint22.1-beta#108.
  • Loading branch information
mtwebster committed Jan 6, 2025
1 parent 7c6c525 commit 256ad2f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/ui/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,10 @@ function showEndSessionDialog(mode) {
}

endSessionDialog = new EndSessionDialog(mode);
endSessionDialog.open();
if (!endSessionDialog.open()) {
endSessionDialog = null;
global.logWarning("Failed to open end session dialog");
}
}

function closeEndSessionDialog() {
Expand Down

0 comments on commit 256ad2f

Please sign in to comment.