1 #include "openbox/actions.h"
2 #include "openbox/misc.h"
3 #include "openbox/client.h"
4 #include "openbox/frame.h"
5 #include "openbox/geom.h"
12 static gpointer setup_north_func(ObParseInst *i, xmlDocPtr doc,
14 static gpointer setup_south_func(ObParseInst *i, xmlDocPtr doc,
16 static gpointer setup_east_func(ObParseInst *i, xmlDocPtr doc,
18 static gpointer setup_west_func(ObParseInst *i, xmlDocPtr doc,
20 static gboolean run_func(ObActionsData *data, gpointer options);
22 void action_movetoedge_startup(void)
24 actions_register("MoveToEdgeNorth", setup_north_func, g_free, run_func,
26 actions_register("MoveToEdgeSouth", setup_south_func, g_free, run_func,
28 actions_register("MoveToEdgeEast", setup_east_func, g_free, run_func,
30 actions_register("MoveToEdgeWest", setup_west_func, g_free, run_func,
34 static gpointer setup_north_func(ObParseInst *i, xmlDocPtr doc,
37 Options *o = g_new0(Options, 1);
38 o->dir = OB_DIRECTION_NORTH;
42 static gpointer setup_south_func(ObParseInst *i, xmlDocPtr doc,
45 Options *o = g_new0(Options, 1);
46 o->dir = OB_DIRECTION_SOUTH;
50 static gpointer setup_east_func(ObParseInst *i, xmlDocPtr doc,
53 Options *o = g_new0(Options, 1);
54 o->dir = OB_DIRECTION_EAST;
58 static gpointer setup_west_func(ObParseInst *i, xmlDocPtr doc,
61 Options *o = g_new0(Options, 1);
62 o->dir = OB_DIRECTION_WEST;
66 /* Always return FALSE because its not interactive */
67 static gboolean run_func(ObActionsData *data, gpointer options)
74 client_find_move_directional(data->client, o->dir, &x, &y);
75 if (x != data->client->area.x || y != data->client->area.y) {
76 actions_client_move(data, TRUE);
77 client_move(data->client, x, y);
78 actions_client_move(data, FALSE);