menu: support <action name="Execute"> option <execute>

<exectue> is a deprecated name for <command>.
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.
This commit is contained in:
Johan Malm 2022-05-06 21:55:46 +01:00
parent 9554be0ce7
commit 5944813566
2 changed files with 10 additions and 1 deletions

View file

@ -12,7 +12,9 @@ Actions are used in keyboard bindings.
Close top-most view.
*<action name="Execute"><command>*
Execute command.
Execute command. Note that in the interest of backward compatibility,
labwc supports <execute> as an alternative to <command> even though
openbox documentation states that it is deprecated.
*<action name="Exit">*
Exit labwc.

View file

@ -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")) {
/*
* <action name="Execute"><execute>foo</execute></action>
* is deprecated, but we support it anyway for backward
* compatibility with old openbox-menu generators
*/
current_item_action->arg = strdup(content);
}
}