1 #include "openbox/actions.h"
2 #include "openbox/client.h"
3 #include "openbox/screen.h"
10 static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node);
11 static void free_func(gpointer options);
12 static gboolean run_func(ObActionsData *data, gpointer options);
14 void action_omnipresent_startup()
16 actions_register("omnipresent",
23 static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
28 o = g_new0(Options, 1);
31 if ((n = parse_find_node("state", node))) {
32 gchar *s = parse_string(doc, n);
33 if (g_ascii_strcasecmp(s, "toggle")) {
35 o->on = parse_bool(doc, n);
43 static void free_func(gpointer options)
50 /* Always return FALSE because its not interactive */
51 static gboolean run_func(ObActionsData *data, gpointer options)
56 if (o->toggle || (o->on != (data->client->desktop == DESKTOP_ALL)))
57 client_set_desktop(data->client,
58 data->client->desktop == DESKTOP_ALL ?
59 screen_desktop : DESKTOP_ALL, FALSE, TRUE);