From 5944813566cf9997891a44549faa813abf6d5182 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Fri, 6 May 2022 21:55:46 +0100 Subject: [PATCH] menu: support option is a deprecated name for . See: http://openbox.org/wiki/Help:Actions#Action_syntax But some openbox3 menu generators still use it, for example https://wiki.archlinux.org/title/xdg-menu - so let's support it for backward compatibility. --- docs/labwc-actions.5.scd | 4 +++- src/menu/menu.c | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/labwc-actions.5.scd b/docs/labwc-actions.5.scd index ef65a524..c36c731e 100644 --- a/docs/labwc-actions.5.scd +++ b/docs/labwc-actions.5.scd @@ -12,7 +12,9 @@ Actions are used in keyboard bindings. Close top-most view. ** - Execute command. + Execute command. Note that in the interest of backward compatibility, + labwc supports as an alternative to even though + openbox documentation states that it is deprecated. ** Exit labwc. diff --git a/src/menu/menu.c b/src/menu/menu.c index fda73cee..846125a8 100644 --- a/src/menu/menu.c +++ b/src/menu/menu.c @@ -180,6 +180,13 @@ fill_item(char *nodename, char *content) "nodename: '%s' content: '%s'", nodename, content); } else if (!strcmp(nodename, "command.action")) { current_item_action->arg = strdup(content); + } else if (!strcmp(nodename, "execute.action")) { + /* + * foo + * is deprecated, but we support it anyway for backward + * compatibility with old openbox-menu generators + */ + current_item_action->arg = strdup(content); } }