1 #include "openbox/action.h"
2 #include "openbox/action_list_run.h"
3 #include "openbox/client.h"
5 static gboolean run_func_on(const ObActionListRun *data, gpointer options);
6 static gboolean run_func_off(const ObActionListRun *data, gpointer options);
7 static gboolean run_func_toggle(const ObActionListRun *data, gpointer options);
9 void action_decorations_startup(void)
11 action_register("Decorate", OB_ACTION_DEFAULT_FILTER_SINGLE,
12 NULL, NULL, run_func_on);
13 action_register("Undecorate", OB_ACTION_DEFAULT_FILTER_SINGLE,
14 NULL, NULL, run_func_off);
15 action_register("ToggleDecorations", OB_ACTION_DEFAULT_FILTER_SINGLE,
16 NULL, NULL, run_func_toggle);
19 /* Always return FALSE because its not interactive */
20 static gboolean run_func_on(const ObActionListRun *data, gpointer options)
23 action_client_move(data, TRUE);
24 client_set_undecorated(data->client, FALSE);
25 action_client_move(data, FALSE);
30 /* Always return FALSE because its not interactive */
31 static gboolean run_func_off(const ObActionListRun *data, gpointer options)
34 action_client_move(data, TRUE);
35 client_set_undecorated(data->client, TRUE);
36 action_client_move(data, FALSE);
41 /* Always return FALSE because its not interactive */
42 static gboolean run_func_toggle(const ObActionListRun *data, gpointer options)
45 action_client_move(data, TRUE);
46 client_set_undecorated(data->client, !data->client->undecorated);
47 action_client_move(data, FALSE);