diff options
Diffstat (limited to 'src/root.c')
-rw-r--r-- | src/root.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -18,7 +18,6 @@ #define ROOT_MENU_COUNT 10 static Menu *rootMenu[ROOT_MENU_COUNT]; -static int showExitConfirmation = 1; static void ExitHandler(ClientNode *np); static void PatchRootMenu(Menu *menu); @@ -131,12 +130,6 @@ void SetRootMenu(const char *indexes, Menu *m) { /*************************************************************************** ***************************************************************************/ -void SetShowExitConfirmation(int v) { - showExitConfirmation = v; -} - -/*************************************************************************** - ***************************************************************************/ int IsRootMenuDefined(int index) { if(index >= 0 && index < ROOT_MENU_COUNT && rootMenu[index]) { return 1; @@ -228,8 +221,8 @@ void Restart() { /*************************************************************************** ***************************************************************************/ -void Exit() { - if(showExitConfirmation) { +void Exit(int confirm) { + if(confirm) { ShowConfirmDialog(NULL, ExitHandler, "Exit JWM", "Are you sure?", @@ -251,12 +244,19 @@ void RunRootCommand(const MenuAction *action) { case MA_RESTART: Restart(); break; + case MA_EXIT_NOW: + if(exitCommand) { + Release(exitCommand); + } + exitCommand = CopyString(action->data.str); + Exit(0); + break; case MA_EXIT: if(exitCommand) { Release(exitCommand); } exitCommand = CopyString(action->data.str); - Exit(); + Exit(1); break; case MA_DESKTOP: ChangeDesktop(action->data.i); |