]>
Dogcows Code - chaz/openbox/blob - moverelative.c
ccdff545d5702d02c4a470e98df31b3249c7e823
1 #include "openbox/actions.h"
2 #include "openbox/client.h"
3 #include "openbox/screen.h"
4 #include "openbox/frame.h"
5 #include <stdlib.h> /* for atoi */
12 static gpointer
setup_func(xmlNodePtr node
);
13 static gboolean
run_func(ObActionsData
*data
, gpointer options
);
15 void action_moverelative_startup(void)
17 actions_register("MoveRelative", setup_func
, g_free
, run_func
, NULL
, NULL
);
20 static gpointer
setup_func(xmlNodePtr node
)
25 o
= g_new0(Options
, 1);
27 if ((n
= obt_parse_find_node(node
, "x")))
28 o
->x
= obt_parse_node_int(n
);
29 if ((n
= obt_parse_find_node(node
, "y")))
30 o
->y
= obt_parse_node_int(n
);
35 /* Always return FALSE because its not interactive */
36 static gboolean
run_func(ObActionsData
*data
, gpointer options
)
42 gint x
, y
, lw
, lh
, w
, h
;
45 x
= data
->client
->area
.x
+ o
->x
;
46 y
= data
->client
->area
.y
+ o
->y
;
47 w
= data
->client
->area
.width
;
48 h
= data
->client
->area
.height
;
49 client_try_configure(data
->client
, &x
, &y
, &w
, &h
, &lw
, &lh
, TRUE
);
50 client_find_onscreen(data
->client
, &x
, &y
, w
, h
, FALSE
);
52 actions_client_move(data
, TRUE
);
53 client_configure(data
->client
, x
, y
, w
, h
, TRUE
, TRUE
, FALSE
);
54 actions_client_move(data
, FALSE
);
This page took 0.033644 seconds and 3 git commands to generate.