diff options
author | rafa_99 <rafa99@protonmail.com> | 2021-04-14 02:14:00 +0100 |
---|---|---|
committer | rafa_99 <rafa99@protonmail.com> | 2021-04-14 02:14:00 +0100 |
commit | 9bec820eb41c258bc839c165640c2575f4e6bc3e (patch) | |
tree | 78eeceefc393cf0a828cd51877ad4c0343d6987f /dwm.c | |
parent | bf36da50269ba67c788f480ade2dcf69710f5654 (diff) |
Singular Borders Patch
Diffstat (limited to 'dwm.c')
-rw-r--r-- | dwm.c | 26 |
1 files changed, 17 insertions, 9 deletions
@@ -849,6 +849,8 @@ expose(XEvent *e) void focus(Client *c) { + XWindowChanges wc; + if (!c || !ISVISIBLE(c)) for (c = selmon->stack; c && !ISVISIBLE(c); c = c->snext); if (selmon->sel && selmon->sel != c) @@ -862,6 +864,11 @@ focus(Client *c) attachstack(c); grabbuttons(c, 1); XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel); + if (!c->isfloating) { + wc.sibling = selmon->barwin; + wc.stack_mode = Below; + XConfigureWindow(dpy, c->win, CWSibling | CWStackMode, &wc); + } setfocus(c); } else { XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); @@ -1182,7 +1189,7 @@ monocle(Monitor *m) if (n > 0) /* override layout symbol */ snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) - resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); + resize(c, m->wx - c->bw, m->wy, m->ww, m->wh, False); } void @@ -1829,14 +1836,15 @@ tile(Monitor *m) 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); + if (n == 1) + resize(c, m->wx - c->bw, m->wy, m->ww, m->wh, False); + else + resize(c, m->wx - c->bw, m->wy + my, mw - c->bw, h - c->bw, False); + my += HEIGHT(c) - c->bw; } 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); + resize(c, m->wx + mw - c->bw, m->wy + ty, m->ww - mw, h - c->bw, False); + ty += HEIGHT(c) - c->bw; } } @@ -2597,12 +2605,12 @@ fibonacci(Monitor *mon, int s) { for(n = 0, c = nexttiled(mon->clients); c; c = nexttiled(c->next), n++); if(n == 0) return; - + nx = mon->wx; ny = 0; nw = mon->ww; nh = mon->wh; - + for(i = 0, c = nexttiled(mon->clients); c; c = nexttiled(c->next)) { if((i % 2 && nh / 2 > 2 * c->bw) || (!(i % 2) && nw / 2 > 2 * c->bw)) { |