aboutsummaryrefslogtreecommitdiff
path: root/src/parse.c
diff options
context:
space:
mode:
authorJohn Ankarstrom <john@ankarstrom.se>2021-06-30 20:01:38 +0200
committerJohn Ankarstrom <john@ankarstrom.se>2021-06-30 20:01:38 +0200
commit0d1af7a8c8e163250e940833d646a12852aa9e5b (patch)
tree4390dc3979aa499c1dc357ef7bd0e8a19f88e7b3 /src/parse.c
parent5bca4a0a26f89c70357fbbbe13ad1fe9d3b07b24 (diff)
downloadjwm-0d1af7a8c8e163250e940833d646a12852aa9e5b.tar.gz
Associate 'confirm' value with each individual Exit menu item
Previously, the 'confirm' property would set a global value, controlling the behavior of all exits.
Diffstat (limited to 'src/parse.c')
-rw-r--r--src/parse.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/parse.c b/src/parse.c
index 65e3197..45a0470 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -649,11 +649,10 @@ MenuItem *ParseMenuItem(const TokenNode *start, Menu *menu,
}
value = FindAttribute(start->attributes, CONFIRM_ATTRIBUTE);
- if(value && !strcmp(value, FALSE_VALUE)) {
- SetShowExitConfirmation(0);
- } else {
- SetShowExitConfirmation(1);
- }
+ if(value && !strcmp(value, FALSE_VALUE))
+ last->action.type = MA_EXIT_NOW;
+ else
+ last->action.type = MA_EXIT;
value = FindAttribute(start->attributes, LABEL_ATTRIBUTE);
if(!value) {
@@ -664,7 +663,6 @@ MenuItem *ParseMenuItem(const TokenNode *start, Menu *menu,
value = FindAttribute(start->attributes, ICON_ATTRIBUTE);
last->iconName = CopyString(value);
- last->action.type = MA_EXIT;
last->action.data.str = CopyString(start->value);
break;