]> git.sur5r.net Git - i3/i3/commitdiff
take into account x11 border_width settings (fixes uxterm border issue)
authorMichael Stapelberg <michael@stapelberg.de>
Sun, 14 Nov 2010 22:44:13 +0000 (23:44 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Sun, 14 Nov 2010 22:44:13 +0000 (23:44 +0100)
include/data.h
src/manage.c
src/render.c

index d34fd733af1ab472c8c1197ba5bbfcffba09f41b..cc9fca1db7a9f82912bd846881c14efdd5aefd8c 100644 (file)
@@ -297,6 +297,9 @@ struct Con {
     int base_width;
     int base_height;
 
+    /* the x11 border pixel attribute */
+    int border_width;
+
     /* minimum increment size specified for the window (in pixels) */
     int width_increment;
     int height_increment;
index d0ecf1eba1ba11ca79ba7f1670284908dfc9af00..548e5da7419c41206250180cce054e8347ef845e 100644 (file)
@@ -185,6 +185,8 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki
     nc->window = cwindow;
     x_reinit(nc);
 
+    nc->border_width = geom->border_width;
+
     char *name;
     asprintf(&name, "[i3 con] container around %p", cwindow);
     x_set_name(nc, name);
index ddb3751a91bacdcf50be54eea6a79cba4e337f0b..f8305d5438af2639f807a42f6db42d60e428467c 100644 (file)
@@ -51,6 +51,10 @@ void render_con(Con *con) {
         *inset = (Rect){0, 0, con->rect.width, con->rect.height};
         *inset = rect_add(*inset, con_border_style_rect(con));
 
+        /* Obey x11 border */
+        inset->width -= (2 * con->border_width);
+        inset->height -= (2 * con->border_width);
+
         /* Obey the aspect ratio, if any */
         if (con->proportional_height != 0 &&
             con->proportional_width != 0) {