From 0eb5eb34cdb88527b31d7827cf803ccdcbce4eea Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 17 Jan 2011 14:38:16 +0100 Subject: [PATCH] When in stacking mode with only one child, respect border styles 1pixel and none (Thanks Merovius) --- src/con.c | 4 ++-- src/render.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/con.c b/src/con.c index ba42a13d..d5389ff4 100644 --- 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; } diff --git a/src/render.c b/src/render.c index f503ec14..9d214ce6 100644 --- a/src/render.c +++ b/src/render.c @@ -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 */ -- 2.39.5