]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: restore the original width/height with X11 border when restarting (Thanks...
authorMichael Stapelberg <michael@stapelberg.de>
Mon, 21 Feb 2011 02:13:27 +0000 (03:13 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Mon, 21 Feb 2011 02:13:27 +0000 (03:13 +0100)
src/manage.c
src/render.c

index 5b60e44cdb1a2fba0bf73ba1c8ce7c7e904bbc38..f41ab41286ec183f6f2ffd38ef3b0a75191b366d 100644 (file)
@@ -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;
index 9e2fd3db233e57aa74c2200c8c3532e1332e16ae..af062c8525d515ccb6b9c1932e730c2e21650242 100644 (file)
@@ -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);