From: Michael Stapelberg Date: Sat, 17 Sep 2011 13:11:01 +0000 (+0100) Subject: Bugfix: Honor the X11 window border in ConfigureRequests X-Git-Tag: 4.1~158^2^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f2f636f9e7872ff19c31649b24d5a19a826e22bd;p=i3%2Fi3 Bugfix: Honor the X11 window border in ConfigureRequests --- diff --git a/src/handlers.c b/src/handlers.c index 72e135db..b3467990 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -353,25 +353,27 @@ static int handle_configure_request(xcb_configure_request_event_t *event) { bsr.y += deco_height; bsr.height -= deco_height; } - con = con->parent; + Con *floatingcon = con->parent; DLOG("Container is a floating leaf node, will do that.\n"); if (event->value_mask & XCB_CONFIG_WINDOW_X) { - con->rect.x = event->x + (-1) * bsr.x; - DLOG("proposed x = %d, new x is %d\n", event->x, con->rect.x); + floatingcon->rect.x = event->x + (-1) * bsr.x; + DLOG("proposed x = %d, new x is %d\n", event->x, floatingcon->rect.x); } if (event->value_mask & XCB_CONFIG_WINDOW_Y) { - con->rect.y = event->y + (-1) * bsr.y; - DLOG("proposed y = %d, new y is %d\n", event->y, con->rect.y); + floatingcon->rect.y = event->y + (-1) * bsr.y; + DLOG("proposed y = %d, new y is %d\n", event->y, floatingcon->rect.y); } if (event->value_mask & XCB_CONFIG_WINDOW_WIDTH) { - con->rect.width = event->width + (-1) * bsr.width; - DLOG("proposed width = %d, new width is %d\n", event->width, con->rect.width); + floatingcon->rect.width = event->width + (-1) * bsr.width; + floatingcon->rect.width += con->border_width * 2; + DLOG("proposed width = %d, new width is %d (x11 border %d)\n", event->width, floatingcon->rect.width, con->border_width); } if (event->value_mask & XCB_CONFIG_WINDOW_HEIGHT) { - con->rect.height = event->height + (-1) * bsr.height; - DLOG("proposed height = %d, new height is %d\n", event->height, con->rect.height); + floatingcon->rect.height = event->height + (-1) * bsr.height; + floatingcon->rect.height += con->border_width * 2; + DLOG("proposed height = %d, new height is %d (x11 border %d)\n", event->height, floatingcon->rect.height, con->border_width); } - floating_maybe_reassign_ws(con); + floating_maybe_reassign_ws(floatingcon); tree_render(); }