]> git.sur5r.net Git - i3/i3/commitdiff
When in stacking mode with only one child, respect border styles 1pixel and none...
authorMichael Stapelberg <michael@stapelberg.de>
Mon, 17 Jan 2011 13:38:16 +0000 (14:38 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Mon, 17 Jan 2011 13:38:16 +0000 (14:38 +0100)
src/con.c
src/render.c

index ba42a13dbaedecc68a5db685771cd67682f5957c..d5389ff45158fbfaebad8f614622c1f1ac13ab8b 100644 (file)
--- a/src/con.c
+++ b/src/con.c
@@ -625,10 +625,10 @@ int con_border_style(Con *con) {
     }
 
     if (con->parent->layout == L_STACKED)
-        return BS_NORMAL;
+        return (con_num_children(con->parent) == 1 ? con->border_style : BS_NORMAL);
 
     if (con->parent->layout == L_TABBED && con->border_style != BS_NORMAL)
-        return con_num_children(con->parent) == 1 ? con->border_style : BS_NORMAL;
+        return (con_num_children(con->parent) == 1 ? con->border_style : BS_NORMAL);
 
     return con->border_style;
 }
index f503ec14dc89bd0acc4d3c99ad8ea78504315e3f..9d214ce6fe3c98b58d4f637bee1fb16a54b5f751 100644 (file)
@@ -168,13 +168,15 @@ void render_con(Con *con, bool render_fullscreen) {
             child->rect.width = rect.width;
             child->rect.height = rect.height;
 
-            child->rect.y += (deco_height * children);
-            child->rect.height -= (deco_height * children);
-
             child->deco_rect.x = x - con->rect.x;
             child->deco_rect.y = y - con->rect.y + (i * deco_height);
             child->deco_rect.width = child->rect.width;
             child->deco_rect.height = deco_height;
+
+            if (children > 1 || (child->border_style != BS_1PIXEL && child->border_style != BS_NONE)) {
+                child->rect.y += (deco_height * children);
+                child->rect.height -= (deco_height * children);
+            }
         }
 
         /* tabbed layout */