aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2024-04-23 15:42:04 +0530
committerAryadev Chavali <aryadev@aryadevchavali.com>2024-04-23 15:42:04 +0530
commitf84237584b76348058bc205b2e0fcf5dfc005d47 (patch)
tree736d5429a0416a3a85996aa6fdfa5e872979589d
parentf98982eca6d534d6bced1da10149750291cdd98b (diff)
downloaddwm-f84237584b76348058bc205b2e0fcf5dfc005d47.tar.gz
dwm-f84237584b76348058bc205b2e0fcf5dfc005d47.tar.bz2
dwm-f84237584b76348058bc205b2e0fcf5dfc005d47.zip
Add gaps to gapless-grid (properly)
This adjusts both the x and y of each client now.
-rw-r--r--gaplessgrid.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gaplessgrid.c b/gaplessgrid.c
index 09d9ac8..649f656 100644
--- a/gaplessgrid.c
+++ b/gaplessgrid.c
@@ -22,10 +22,10 @@ gaplessgrid(Monitor *m) {
for(i = 0, c = nexttiled(m->clients); c; i++, c = nexttiled(c->next)) {
if(i/rows + 1 > cols - n%cols)
rows = n/cols + 1;
- ch = (rows ? m->wh / rows : m->wh);
- cx = (m->wx + cn*cw);
- cy = (m->wy + rn*ch);
- resize(c, cx, cy, cw - 2 * c->bw, ch - 2 * c->bw, False);
+ ch = (rows ? m->wh / rows : m->wh) - m->gappx;
+ cx = (m->wx + cn*cw) + m->gappx;
+ cy = (m->wy + rn*ch) + m->gappx;
+ resize(c, cx + m->gappx, cy + m->gappx, cw - 2 * c->bw - m->gappx, ch - 2 * c->bw - m->gappx, False);
rn++;
if(rn >= rows) {
rn = 0;