From 0a31cd1f6c2fd10ba8d5fcbb4833a2f0387742d1 Mon Sep 17 00:00:00 2001 From: tiyn Date: Sun, 6 Apr 2025 00:43:31 +0200 Subject: [PATCH] merged smartborders --- dwl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dwl.c b/dwl.c index 1b461c8..60921a8 100644 --- a/dwl.c +++ b/dwl.c @@ -1271,7 +1271,7 @@ cursorwarptohint(void) void deck(Monitor *m) { - unsigned int mw, my; + unsigned int mw, my, draw_borders = 1; int i, n = 0; Client *c; @@ -1281,6 +1281,9 @@ deck(Monitor *m) if (n == 0) return; + if (n == smartborders) + draw_borders = 0; + if (n > m->nmaster) mw = m->nmaster ? round(m->w.width * m->mfact) : 0; else @@ -1291,11 +1294,11 @@ deck(Monitor *m) continue; if (i < m->nmaster) { resize(c, (struct wlr_box){.x = m->w.x, .y = m->w.y + my, .width = mw, - .height = (m->w.height - my) / (MIN(n, m->nmaster) - i)}, 0); + .height = (m->w.height - my) / (MIN(n, m->nmaster) - i)}, 0, draw_borders); my += c->geom.height; } else { resize(c, (struct wlr_box){.x = m->w.x + mw, .y = m->w.y, - .width = m->w.width - mw, .height = m->w.height}, 0); + .width = m->w.width - mw, .height = m->w.height}, 0, draw_borders); snprintf(m->ltsymbol, LENGTH(m->ltsymbol), "%d", n-1); if (c == focustop(m)) wlr_scene_node_raise_to_top(&c->scene->node);