1 #include "openbox/action.h"
2 #include "openbox/action_list_run.h"
3 #include "openbox/client.h"
4 #include "openbox/client_set.h"
6 static gboolean run_func_on(const ObClientSet *set,
7 const ObActionListRun *data, gpointer options);
8 static gboolean run_func_off(const ObClientSet *set,
9 const ObActionListRun *data, gpointer options);
10 static gboolean run_func_toggle(const ObClientSet *set,
11 const ObActionListRun *data, gpointer options);
13 void action_fullscreen_startup(void)
15 action_register("Fullscreen", OB_ACTION_DEFAULT_FILTER_SINGLE,
16 NULL, NULL, run_func_on);
17 action_register("Unfullscreen", OB_ACTION_DEFAULT_FILTER_SINGLE,
18 NULL, NULL, run_func_off);
19 action_register("ToggleFullscreen", OB_ACTION_DEFAULT_FILTER_SINGLE,
20 NULL, NULL, run_func_toggle);
23 static gboolean each_on(ObClient *c, const ObActionListRun *data,
26 client_fullscreen(c, TRUE);
30 /* Always return FALSE because its not interactive */
31 static gboolean run_func_on(const ObClientSet *set,
32 const ObActionListRun *data, gpointer options)
34 action_client_move(data, TRUE);
35 client_set_run(set, data, each_on, options);
36 action_client_move(data, FALSE);
40 static gboolean each_off(ObClient *c, const ObActionListRun *data,
43 client_fullscreen(c, FALSE);
47 /* Always return FALSE because its not interactive */
48 static gboolean run_func_off(const ObClientSet *set,
49 const ObActionListRun *data, gpointer options)
51 action_client_move(data, TRUE);
52 client_set_run(set, data, each_off, options);
53 action_client_move(data, FALSE);
57 static gboolean each_toggle(ObClient *c, const ObActionListRun *data,
60 client_fullscreen(c, !c->fullscreen);
64 /* Always return FALSE because its not interactive */
65 static gboolean run_func_toggle(const ObClientSet *set,
66 const ObActionListRun *data, gpointer options)
68 if (!client_set_is_empty(set)) {
69 action_client_move(data, TRUE);
70 client_set_run(set, data, each_toggle, options);
71 action_client_move(data, FALSE);