]> git.sur5r.net Git - i3/i3/commitdiff
Fix decoration rect size for windows without border
authorMarius Muja <mariusm@cs.ubc.ca>
Mon, 31 Dec 2012 11:04:53 +0000 (03:04 -0800)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 26 Jan 2013 18:31:15 +0000 (19:31 +0100)
src/render.c

index 85347c4cf7ad9997bd4e1a07bc63a507e2700770..9ac4b78ef2c81de4145170fe8b8e7f4d205deb81 100644 (file)
@@ -309,16 +309,23 @@ void render_con(Con *con, bool render_fullscreen) {
             }
 
             /* first we have the decoration, if this is a leaf node */
-            if (con_is_leaf(child) && child->border_style == BS_NORMAL) {
-                /* TODO: make a function for relative coords? */
-                child->deco_rect.x = child->rect.x - con->rect.x;
-                child->deco_rect.y = child->rect.y - con->rect.y;
-
-                child->rect.y += deco_height;
-                child->rect.height -= deco_height;
-
-                child->deco_rect.width = child->rect.width;
-                child->deco_rect.height = deco_height;
+            if (con_is_leaf(child)) {
+                if (child->border_style == BS_NORMAL) {
+                    /* TODO: make a function for relative coords? */
+                    child->deco_rect.x = child->rect.x - con->rect.x;
+                    child->deco_rect.y = child->rect.y - con->rect.y;
+
+                    child->rect.y += deco_height;
+                    child->rect.height -= deco_height;
+
+                    child->deco_rect.width = child->rect.width;
+                    child->deco_rect.height = deco_height;
+                } else {
+                    child->deco_rect.x = 0;
+                    child->deco_rect.y = 0;
+                    child->deco_rect.width = 0;
+                    child->deco_rect.height = 0;
+                }
             }
         }