From d5b301e51c75bb1808ac2a99109423846283dc35 Mon Sep 17 00:00:00 2001 From: pgrondek Date: Mon, 1 Jun 2020 01:31:44 +0200 Subject: [PATCH] Make gapps work with column layout --- dwm.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dwm.c b/dwm.c index 47f7bfb..5b3b6ed 100644 --- a/dwm.c +++ b/dwm.c @@ -1931,19 +1931,19 @@ col(Monitor *m) { if(n == 0) return; if(n > m->nmaster) - mw = m->nmaster ? m->ww * m->mfact : 0; + mw = m->nmaster ? m->ww * m->mfact : 0; else - mw = m->ww; - for(i = x = y = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { + mw = m->ww - m->gappx; + for(i =0, x = y = m->gappx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { if(i < m->nmaster) { - w = (mw - x) / (MIN(n, m->nmaster)-i); - resize(c, x + m->wx, m->wy, w - (2*c->bw), m->wh - (2*c->bw), False); - x += WIDTH(c); + w = (mw - x) / (MIN(n, m->nmaster)-i) - m->gappx; + resize(c, x + m->wx + m->gappx, m->wy + m->gappx, w - (2*c->bw) - (2*m->gappx), m->wh - ((2*c->bw) + (2*m->gappx)), False); + x += WIDTH(c) + m->gappx; } else { h = (m->wh - y) / (n - i); - resize(c, x + m->wx, m->wy + y, m->ww - x - (2*c->bw), h - (2*c->bw), False); - y += HEIGHT(c); + resize(c, x + m->wx + m->gappx, m->wy + y, m->ww - x - (2*c->bw) - (2*m->gappx), h - (2*c->bw), False); + y += HEIGHT(c) + m->gappx; } } }