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
);
18 static gpointer
setup_func(xmlNodePtr node
)
23 o
= g_new0(Options
, 1);
25 if ((n
= obt_parse_find_node(node
, "menu")))
26 o
->name
= obt_parse_node_string(n
);
30 static void free_func(gpointer options
)
37 /* Always return FALSE because its not interactive */
38 static gboolean
run_func(ObActionsData
*data
, gpointer options
)
42 /* you cannot call ShowMenu from inside a menu */
43 if (data
->uact
!= OB_USER_ACTION_MENU_SELECTION
&& o
->name
)
44 menu_show(o
->name
, data
->x
, data
->y
, data
->button
!= 0, data
->client
);