aboutsummaryrefslogtreecommitdiff
path: root/src/render.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/render.c')
-rw-r--r--src/render.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/render.c b/src/render.c
index fc2cedd9..b9fa3903 100644
--- a/src/render.c
+++ b/src/render.c
@@ -49,13 +49,28 @@ void render_con(Con *con) {
DLOG("Rendering node %p / %s / layout %d / children %d\n", con, con->name,
con->layout, params.children);
+ if (con->type == CT_WORKSPACE) {
+ gaps_t gaps = calculate_effective_gaps(con);
+ Rect inset = (Rect){
+ gaps.left,
+ gaps.top,
+ -(gaps.left + gaps.right),
+ -(gaps.top + gaps.bottom),
+ };
+ con->rect = rect_add(con->rect, inset);
+ params.rect = rect_add(params.rect, inset);
+ params.x += gaps.left;
+ params.y += gaps.top;
+ }
+
if (gaps_should_inset_con(con, params.children)) {
gaps_t gaps = calculate_effective_gaps(con);
Rect inset = (Rect){
- gaps_has_adjacent_container(con, D_LEFT) ? gaps.inner : gaps.left,
- gaps_has_adjacent_container(con, D_UP) ? gaps.inner : gaps.top,
- gaps_has_adjacent_container(con, D_RIGHT) ? -gaps.inner : -gaps.right,
- gaps_has_adjacent_container(con, D_DOWN) ? -gaps.inner : -gaps.bottom};
+ gaps_has_adjacent_container(con, D_LEFT) ? gaps.inner / 2 : gaps.inner,
+ gaps_has_adjacent_container(con, D_UP) ? gaps.inner / 2 : gaps.inner,
+ gaps_has_adjacent_container(con, D_RIGHT) ? -(gaps.inner / 2) : -gaps.inner,
+ gaps_has_adjacent_container(con, D_DOWN) ? -(gaps.inner / 2) : -gaps.inner,
+ };
inset.width -= inset.x;
inset.height -= inset.y;