X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Faction.c;h=6ba52c8959f13d140fbea9a3f5f0e1a7ae3adb08;hb=aaba799e1d7d48f33de3eb7b8956f5572c013141;hp=661ab09fe3b6023abbede3b7d223edd61eab15f7;hpb=220e568d75eaad436be403cd66d4e47d31d42392;p=chaz%2Fopenbox diff --git a/openbox/action.c b/openbox/action.c index 661ab09f..6ba52c89 100644 --- a/openbox/action.c +++ b/openbox/action.c @@ -60,8 +60,12 @@ static void client_action_end(union ActionData *data, gboolean allow_enters) event will come as a GrabNotify which is ignored, so this makes a fake enter event */ - if ((c = client_under_pointer()) && c != data->any.c) + if ((c = client_under_pointer()) && c != data->any.c) { + ob_debug_type(OB_DEBUG_FOCUS, + "Generating fake enter because we did a " + "mouse-event action"); event_enter_client(c); + } } } } @@ -1426,11 +1430,12 @@ void action_move_to_center(union ActionData *data) { ObClient *c = data->client.any.c; Rect *area; - area = screen_area_monitor(c->desktop, 0); + area = screen_area(c->desktop, client_monitor(c), NULL); client_action_start(data); client_move(c, area->width / 2 - c->area.width / 2, area->height / 2 - c->area.height / 2); client_action_end(data, FALSE); + g_free(area); } void action_resize_relative_horz(union ActionData *data) @@ -1466,21 +1471,30 @@ void action_move_relative(union ActionData *data) void action_resize_relative(union ActionData *data) { ObClient *c = data->relative.any.c; - gint x, y, w1, w2, h1, h2, 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; - w1 = c->area.width + data->relative.deltax * c->size_inc.width; - w2 = c->area.width + data->relative.deltax * c->size_inc.width + ow = c->area.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; - h1 = c->area.height + data->relative.deltay * c->size_inc.height; - h2 = c->area.height + data->relative.deltay * c->size_inc.height + oh = c->area.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, &w2, &h2, &lw, &lh, TRUE); - client_move_resize(c, x + (w1 - w2), y + (h1 - h2), w2, h2); + 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); } @@ -1831,7 +1845,6 @@ void action_directional_focus(union ActionData *data) on us */ event_halt_focus_delay(); - g_print("action\n"); focus_directional_cycle(data->interdiraction.direction, data->interdiraction.dock_windows, data->interdiraction.desktop_windows, @@ -1885,7 +1898,7 @@ void action_growtoedge(union ActionData *data) ObClient *c = data->diraction.any.c; Rect *a; - a = screen_area(c->desktop); + a = screen_area(c->desktop, SCREEN_AREA_ALL_MONITORS, &c->frame->area); x = c->frame->area.x; y = c->frame->area.y; /* get the unshaded frame's dimensions..if it is shaded */ @@ -1944,6 +1957,7 @@ void action_growtoedge(union ActionData *data) client_action_start(data); client_move_resize(c, x, y, width, height); client_action_end(data, FALSE); + g_free(a); } void action_send_to_layer(union ActionData *data)