diff --git a/dwm b/dwm index 56b52e5..aa42f49 100755 Binary files a/dwm and b/dwm differ diff --git a/dwm.o b/dwm.o index 83f6d6a..931c5f9 100644 Binary files a/dwm.o and b/dwm.o differ diff --git a/layouts.c b/layouts.c index 39e154d..c88b155 100644 --- a/layouts.c +++ b/layouts.c @@ -41,7 +41,6 @@ monocle(Monitor *m) resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); } -// TODO: Add gaps void gaplessgrid(Monitor *m) { unsigned int n, cols, rows, cn, rn, i, cx, cy, cw, ch; @@ -60,16 +59,16 @@ gaplessgrid(Monitor *m) { rows = n/cols; /* window geometries */ - cw = cols ? m->ww / cols : m->ww; + cw = cols ? (m->ww - gappx) / cols : m->ww - gappx; cn = 0; /* current column number */ rn = 0; /* current row number */ 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; + ch = rows ? (m->wh - gappx) / rows : m->wh - gappx; cx = m->wx + cn*cw; cy = m->wy + rn*ch; - resize(c, cx, cy, cw - 2 * c->bw, ch - 2 * c->bw, False); + resize(c, cx + gappx, cy + gappx, cw - 2 * c->bw - gappx, ch - 2 * c->bw - gappx, False); rn++; if(rn >= rows) { rn = 0;