aboutsummaryrefslogtreecommitdiff
path: root/src/root.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/root.c')
-rw-r--r--src/root.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/root.c b/src/root.c
index b110018..13f85e6 100644
--- a/src/root.c
+++ b/src/root.c
@@ -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);