diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2024-05-22 12:58:03 +0530 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2024-05-22 14:01:19 +0530 |
commit | 83c004cd19eead9219f792b7e9782a3c9b63f466 (patch) | |
tree | 9b7b799e7773ecf716e230526d0b87abeba7cf92 /gaplessgrid.c | |
parent | f8aa7781bb890992b75fbc2c9039e2477f1a09c6 (diff) | |
download | dwm-83c004cd19eead9219f792b7e9782a3c9b63f466.tar.gz dwm-83c004cd19eead9219f792b7e9782a3c9b63f466.tar.bz2 dwm-83c004cd19eead9219f792b7e9782a3c9b63f466.zip |
[PATCH] Adjust gapless grid for pertag gaps
Diffstat (limited to 'gaplessgrid.c')
-rw-r--r-- | gaplessgrid.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gaplessgrid.c b/gaplessgrid.c index 649f656..3c9ad76 100644 --- a/gaplessgrid.c +++ b/gaplessgrid.c @@ -15,6 +15,7 @@ gaplessgrid(Monitor *m) { cols = 2; rows = n/cols; + const int gap_size = m->pertag->gaps[m->pertag->curtag]; /* window geometries */ cw = cols ? m->ww / cols : m->ww; cn = 0; /* current column number */ @@ -22,10 +23,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) - 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); + ch = (rows ? m->wh / rows : m->wh) - gap_size; + cx = (m->wx + cn*cw) + gap_size; + cy = (m->wy + rn*ch) + gap_size; + resize(c, cx + gap_size, cy + gap_size, cw - 2 * c->bw - gap_size, ch - 2 * c->bw - gap_size, False); rn++; if(rn >= rows) { rn = 0; |