1 #include "openbox/actions.h"
2 #include "openbox/menu.h"
9 static gpointer setup_func(xmlNodePtr node);
10 static void free_func(gpointer options);
11 static gboolean run_func(ObActionsData *data, gpointer options);
13 void action_showmenu_startup(void)
15 actions_register("ShowMenu", setup_func, free_func, run_func,
19 static gpointer setup_func(xmlNodePtr node)
24 o = g_new0(Options, 1);
26 if ((n = obt_parse_find_node(node, "menu")))
27 o->name = obt_parse_node_string(n);
31 static void free_func(gpointer options)
38 /* Always return FALSE because its not interactive */
39 static gboolean run_func(ObActionsData *data, gpointer options)
43 /* you cannot call ShowMenu from inside a menu */
44 if (data->uact != OB_USER_ACTION_MENU_SELECTION && o->name)
45 menu_show(o->name, data->x, data->y, data->button != 0, data->client);