Skip to content

Commit 1f2538a

Browse files
committed
runDialog: Fix cinnamon restart OSD showing over dialog
This regression was introduced by 67bef86 The OPEN_AND_CLOSE_TIME constant which had been removed was used by runDialog.
1 parent 264b6c0 commit 1f2538a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

js/ui/runDialog.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ const DEVEL_COMMANDS = { 'lg': x => Main.createLookingGlass().open(),
4747
'debugexit': x => Meta.quit(Meta.ExitCode.ERROR),
4848
'rt': x => Main.themeManager._changeTheme() };
4949

50-
/* The modal dialog parent class has a 100ms close animation. Delay long enough for it
51-
* to complete before doing something disruptive like restarting cinnamon */
52-
const DEVEL_COMMAND_DELAY = parseInt(ModalDialog.OPEN_AND_CLOSE_TIME) + 10;
53-
5450
/**
5551
* completeCommand:
5652
* @text (string): initial string to complete.
@@ -396,7 +392,9 @@ class RunDialog extends ModalDialog.ModalDialog {
396392
this._history.addItem(input);
397393
this._commandError = false;
398394
if (this._enableInternalCommands && input in DEVEL_COMMANDS) {
399-
Mainloop.timeout_add(DEVEL_COMMAND_DELAY, ()=>DEVEL_COMMANDS[input]());
395+
/* Delay 10ms past the modalDialog's openAndCloseTime to ensure the dialog
396+
* is closed before doing something disruptive like restarting cinnamon */
397+
Mainloop.timeout_add(this.openAndCloseTime + 10, ()=>DEVEL_COMMANDS[input]());
400398
return;
401399
}
402400

0 commit comments

Comments
 (0)