Skip to content

Commit

Permalink
runDialog: Fix cinnamon restart OSD showing over dialog
Browse files Browse the repository at this point in the history
This regression was introduced by
67bef86

The OPEN_AND_CLOSE_TIME constant which had been removed was used
by runDialog.
  • Loading branch information
clefebvre committed Dec 23, 2024
1 parent 264b6c0 commit 1f2538a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions js/ui/runDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ const DEVEL_COMMANDS = { 'lg': x => Main.createLookingGlass().open(),
'debugexit': x => Meta.quit(Meta.ExitCode.ERROR),
'rt': x => Main.themeManager._changeTheme() };

/* The modal dialog parent class has a 100ms close animation. Delay long enough for it
* to complete before doing something disruptive like restarting cinnamon */
const DEVEL_COMMAND_DELAY = parseInt(ModalDialog.OPEN_AND_CLOSE_TIME) + 10;

/**
* completeCommand:
* @text (string): initial string to complete.
Expand Down Expand Up @@ -396,7 +392,9 @@ class RunDialog extends ModalDialog.ModalDialog {
this._history.addItem(input);
this._commandError = false;
if (this._enableInternalCommands && input in DEVEL_COMMANDS) {
Mainloop.timeout_add(DEVEL_COMMAND_DELAY, ()=>DEVEL_COMMANDS[input]());
/* Delay 10ms past the modalDialog's openAndCloseTime to ensure the dialog
* is closed before doing something disruptive like restarting cinnamon */
Mainloop.timeout_add(this.openAndCloseTime + 10, ()=>DEVEL_COMMANDS[input]());
return;
}

Expand Down

0 comments on commit 1f2538a

Please sign in to comment.