X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Faction.c;h=4c745b2dafc538f9f62305daa2a81d68fe1b7cee;hb=62ac5e57a1f48a302e9bb69486f8d8722841e093;hp=80b563f9619a9a139b3ff82b0c8d5797e5100011;hpb=4940d007cce43a135f1b448902f5a3571dbce62a;p=chaz%2Fopenbox diff --git a/openbox/action.c b/openbox/action.c index 80b563f9..4c745b2d 100644 --- a/openbox/action.c +++ b/openbox/action.c @@ -1314,7 +1314,7 @@ void action_focus(union ActionData *data) void action_unfocus (union ActionData *data) { if (data->client.any.c == focus_client) - focus_fallback(FALSE, FALSE); + focus_fallback(FALSE, FALSE, TRUE); } void action_iconify(union ActionData *data) @@ -1466,21 +1466,30 @@ 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; + gint x, y, ow, xoff, nw, oh, yoff, nh, lw, lh; client_action_start(data); x = c->area.x; y = c->area.y; ow = c->area.width; - w = ow + data->relative.deltax * c->size_inc.width + xoff = -data->relative.deltaxl * c->size_inc.width; + nw = 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 + yoff = -data->relative.deltayu * c->size_inc.height; + nh = oh + data->relative.deltay * c->size_inc.height + data->relative.deltayu * c->size_inc.height; + + g_print("deltax %d %d x %d ow %d xoff %d nw %d\n", + data->relative.deltax, + data->relative.deltaxl, + x, ow, xoff, nw); - client_try_configure(c, &x, &y, &w, &h, &lw, &lh, TRUE); - client_move_resize(c, x + (ow - w), y + (oh - h), w, h); + client_try_configure(c, &x, &y, &nw, &nh, &lw, &lh, TRUE); + xoff = xoff == 0 ? 0 : (xoff < 0 ? MAX(xoff, ow-nw) : MIN(xoff, ow-nw)); + yoff = yoff == 0 ? 0 : (yoff < 0 ? MAX(yoff, oh-nh) : MIN(yoff, oh-nh)); + client_move_resize(c, x + xoff, y + yoff, nw, nh); client_action_end(data, FALSE); }