X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Faction.c;h=4c745b2dafc538f9f62305daa2a81d68fe1b7cee;hb=62ac5e57a1f48a302e9bb69486f8d8722841e093;hp=de5f9a8a089682b0c96bd842f8766d840c444455;hpb=097d02d9d3d4b2eeea11084c54812de9cd7d14c0;p=chaz%2Fopenbox diff --git a/openbox/action.c b/openbox/action.c index de5f9a8a..4c745b2d 100644 --- a/openbox/action.c +++ b/openbox/action.c @@ -39,8 +39,11 @@ #include +static gulong ignore_start = 0; + static void client_action_start(union ActionData *data) { + ignore_start = event_start_ignore_all_enters(); } static void client_action_end(union ActionData *data, gboolean allow_enters) @@ -48,7 +51,7 @@ static void client_action_end(union ActionData *data, gboolean allow_enters) if (config_focus_follow) if (data->any.context != OB_FRAME_CONTEXT_CLIENT) { if (!data->any.button && data->any.c && !allow_enters) { - event_ignore_all_queued_enters(); + event_end_ignore_all_enters(ignore_start); } else { ObClient *c; @@ -1311,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) @@ -1463,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); }