From: Michael Stapelberg Date: Mon, 21 Feb 2011 02:13:27 +0000 (+0100) Subject: Bugfix: restore the original width/height with X11 border when restarting (Thanks... X-Git-Tag: tree-pr2~35 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b6f81fe43cf84132ba72dac0da4d0c2ed197ee01;p=i3%2Fi3 Bugfix: restore the original width/height with X11 border when restarting (Thanks Merovius) --- diff --git a/src/manage.c b/src/manage.c index 5b60e44c..f41ab412 100644 --- a/src/manage.c +++ b/src/manage.c @@ -55,7 +55,11 @@ void restore_geometry() { Con *con; TAILQ_FOREACH(con, &all_cons, all_cons) if (con->window) { - DLOG("placing window at %d %d\n", con->rect.x, con->rect.y); + DLOG("Re-adding X11 border of %d px\n", con->border_width); + con->window_rect.width += (2 * con->border_width); + con->window_rect.height += (2 * con->border_width); + xcb_set_window_rect(conn, con->window->id, con->window_rect); + DLOG("placing window %08x at %d %d\n", con->window->id, con->rect.x, con->rect.y); xcb_reparent_window(conn, con->window->id, root, con->rect.x, con->rect.y); } @@ -154,6 +158,7 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki LOG("this window is a dock\n"); } + DLOG("Initial geometry: (%d, %d, %d, %d)\n", geom->x, geom->y, geom->width, geom->height); Con *nc; Match *match; diff --git a/src/render.c b/src/render.c index 9e2fd3db..af062c85 100644 --- a/src/render.c +++ b/src/render.c @@ -140,6 +140,7 @@ void render_con(Con *con, bool render_fullscreen) { *inset = rect_add(*inset, con_border_style_rect(con)); /* Obey x11 border */ + DLOG("X11 border: %d\n", con->border_width); inset->width -= (2 * con->border_width); inset->height -= (2 * con->border_width);