summaryrefslogtreecommitdiff
path: root/openbox/action.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-03-14 03:45:56 +0000
committerDana Jansens <danakj@orodu.net>2007-03-14 03:45:56 +0000
commite2521f5c6477323ec683ace8c0af8b4c58112a54 (patch)
tree492fad1572654b1fdc54414378cfc5aaa5bef881 /openbox/action.c
parent4e19d8411d5619aa2562160de309c47c6e482129 (diff)
a) fix resizerelative moving windows when they reach their minimum size do this by...
b) adding a function to let you see what size/position a window will be given when you actually try move/resize it to some given values. (client_try_configure)
Diffstat (limited to 'openbox/action.c')
-rw-r--r--openbox/action.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/openbox/action.c b/openbox/action.c
index eca4707a..6d455f1f 100644
--- a/openbox/action.c
+++ b/openbox/action.c
@@ -1345,14 +1345,21 @@ void action_move_relative(union ActionData *data)
void action_resize_relative(union ActionData *data)
{
ObClient *c = data->relative.any.c;
+ gint x, y, ow, w, oh, h, lw, lh;
+
client_action_start(data);
- client_move_resize(c,
- c->area.x - data->relative.deltaxl * c->size_inc.width,
- c->area.y - data->relative.deltayu * c->size_inc.height,
- c->area.width + data->relative.deltax * c->size_inc.width
- + data->relative.deltaxl * c->size_inc.width,
- c->area.height + data->relative.deltay * c->size_inc.height
- + data->relative.deltayu * c->size_inc.height);
+
+ x = c->area.x;
+ y = c->area.y;
+ ow = c->area.width;
+ w = ow + data->relative.deltax * c->size_inc.width
+ + data->relative.deltaxl * c->size_inc.width;
+ oh = c->area.height;
+ h = oh + data->relative.deltay * c->size_inc.height
+ + data->relative.deltayu * c->size_inc.height;
+
+ client_try_configure(c, OB_CORNER_TOPLEFT, &x, &y, &w, &h, &lw, &lh, TRUE);
+ client_move_resize(c, x + (ow - w), y + (oh - h), w, h);
client_action_end(data);
}