Make the dock a context and add actions LowerDock and RaiseDock
[mikachu/openbox.git] / openbox / actions / dock.c
1 #include "openbox/actions.h"
2 #include "openbox/stacking.h"
3 #include "openbox/window.h"
4 #include "openbox/dock.h"
5
6 static gboolean raise_func(ObActionsData *data, gpointer options);
7 static gboolean lower_func(ObActionsData *data, gpointer options);
8
9 void action_dock_startup(void)
10 {
11     actions_register("RaiseDock",
12                      NULL, NULL,
13                      raise_func);
14     actions_register("LowerDock",
15                      NULL, NULL,
16                      lower_func);
17 }
18
19 /* Always return FALSE because its not interactive */
20 static gboolean raise_func(ObActionsData *data, gpointer options)
21 {
22     actions_client_move(data, TRUE);
23     dock_raise_dock();
24     actions_client_move(data, FALSE);
25
26     return FALSE;
27 }
28
29 /* Always return FALSE because its not interactive */
30 static gboolean lower_func(ObActionsData *data, gpointer options)
31 {
32     actions_client_move(data, TRUE);
33     dock_lower_dock();
34     actions_client_move(data, FALSE);
35
36     return FALSE;
37 }
38