diff options
author | rafa_99 <rafa99@protonmail.com> | 2020-06-03 23:38:34 +0000 |
---|---|---|
committer | rafa_99 <rafa99@protonmail.com> | 2020-06-03 23:38:34 +0000 |
commit | 9159332a5b47360f7eed208d609959ea1da422d5 (patch) | |
tree | 95e3acd8cf55ba2e35c32a87f88e9721370b96e6 /dwm.c | |
parent | dbae05314f58b685f5029f55f23de28b8d0eb7cb (diff) |
Vanity Gaps Patch
Diffstat (limited to 'dwm.c')
-rw-r--r-- | dwm.c | 37 |
1 files changed, 8 insertions, 29 deletions
@@ -119,6 +119,10 @@ struct Monitor { int by; /* bar geometry */ int mx, my, mw, mh; /* screen size */ int wx, wy, ww, wh; /* window area */ + int gappih; /* horizontal gap between windows */ + int gappiv; /* vertical gap between windows */ + int gappoh; /* horizontal outer gaps */ + int gappov; /* vertical outer gaps */ unsigned int seltags; unsigned int sellt; unsigned int tagset[2]; @@ -216,7 +220,6 @@ static void tag(const Arg *arg); static void tagmon(const Arg *arg); static void tagtoleft(const Arg *arg); static void tagtoright(const Arg *arg); -static void tile(Monitor *); static void togglebar(const Arg *arg); static void togglefloating(const Arg *arg); static void togglefullscr(const Arg *arg); @@ -650,6 +653,10 @@ createmon(void) m->nmaster = nmaster; m->showbar = showbar; m->topbar = topbar; + m->gappih = gappih; + m->gappiv = gappiv; + m->gappoh = gappoh; + m->gappov = gappov; m->lt[0] = &layouts[0]; m->lt[1] = &layouts[1 % LENGTH(layouts)]; strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); @@ -1777,34 +1784,6 @@ tagmon(const Arg *arg) } void -tile(Monitor *m) -{ - unsigned int i, n, h, mw, my, ty; - Client *c; - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - if (n == 0) - return; - - if (n > m->nmaster) - mw = m->nmaster ? m->ww * m->mfact : 0; - else - mw = m->ww; - for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i < m->nmaster) { - h = (m->wh - my) / (MIN(n, m->nmaster) - i); - resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0); - if (my + HEIGHT(c) < m->wh) - my += HEIGHT(c); - } else { - h = (m->wh - ty) / (n - i); - resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0); - if (ty + HEIGHT(c) < m->wh) - ty += HEIGHT(c); - } -} - -void togglebar(const Arg *arg) { selmon->showbar = !selmon->showbar; |