]> icculus.org git repositories - dana/openbox.git/blob - openbox/actions/omnipresent.c
Add action_list_run.c/h with action_list_run() and struct ObActionListRun.
[dana/openbox.git] / openbox / actions / omnipresent.c
1 #include "openbox/action.h"
2 #include "openbox/action_list_run.h"
3 #include "openbox/client.h"
4 #include "openbox/screen.h"
5
6 static gboolean run_func_toggle(const ObActionListRun *data, gpointer options);
7
8 void action_omnipresent_startup(void)
9 {
10     action_register("ToggleOmnipresent", OB_ACTION_DEFAULT_FILTER_SINGLE,
11                     NULL, NULL, run_func_toggle);
12 }
13
14 /* Always return FALSE because its not interactive */
15 static gboolean run_func_toggle(const ObActionListRun *data, gpointer options)
16 {
17     if (data->client) {
18         action_client_move(data, TRUE);
19         client_set_desktop(data->client,
20                            data->client->desktop == DESKTOP_ALL ?
21                            screen_desktop : DESKTOP_ALL, FALSE, TRUE);
22         action_client_move(data, FALSE);
23     }
24     return FALSE;
25 }