Use a helper function to make if.c a bit shorter
[mikachu/openbox.git] / openbox / actions / move.c
1 #include "openbox/actions.h"
2 #include "openbox/moveresize.h"
3 #include "obt/prop.h"
4
5 static gboolean run_func(ObActionsData *data, gpointer options);
6
7 void action_move_startup(void)
8 {
9     actions_register("Move",
10                      NULL, NULL,
11                      run_func);
12 }
13
14 /* Always return FALSE because its not interactive */
15 static gboolean run_func(ObActionsData *data, gpointer options)
16 {
17     if (data->client) {
18         guint32 corner;
19
20         corner = data->button != 0 ?
21             OBT_PROP_ATOM(NET_WM_MOVERESIZE_MOVE) :
22             OBT_PROP_ATOM(NET_WM_MOVERESIZE_MOVE_KEYBOARD);
23
24         moveresize_start(data->client, data->x, data->y, data->button, corner);
25     }
26
27     return FALSE;
28 }