dwm-6.0-singularborders_bstack.diff (2365B)
1 --- dwm.c.orig 2013-03-23 15:10:01.553315130 +0100 2 +++ dwm.c 2013-03-23 15:12:51.639978935 +0100 3 @@ -440,13 +440,16 @@ 4 for(i = mx = tx = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) 5 if(i < m->nmasters[m->curtag]) { 6 w = (m->ww - mx) / (MIN(n, m->nmasters[m->curtag]) - i); 7 - resize(c, m->wx + mx, m->wy, w - (2*c->bw), mh - (2*c->bw), False); 8 - mx += WIDTH(c); 9 + if(n == 1) 10 + resize(c, m->wx - c->bw, m->wy, m->ww, m->wh, False); 11 + else 12 + resize(c, m->wx + mx - c->bw, m->wy, w, mh - c->bw, False); 13 + mx += WIDTH(c) - c->bw; 14 } 15 else { 16 w = (m->ww - tx) / (n - i); 17 - resize(c, m->wx + tx, m->wy + mh, w - (2*c->bw), m->wh - mh - (2*c->bw), False); 18 - tx += WIDTH(c); 19 + resize(c, m->wx + tx - c->bw, m->wy + mh, w, m->wh - mh - c->bw, False); 20 + tx += WIDTH(c) - c->bw; 21 } 22 } 23 24 @@ -869,6 +872,8 @@ 25 26 void 27 focus(Client *c) { 28 + XWindowChanges wc; 29 + 30 if(!c || !ISVISIBLE(c)) 31 for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext); 32 /* was if(selmon->sel) */ 33 @@ -883,6 +888,11 @@ 34 attachstack(c); 35 grabbuttons(c, True); 36 XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); 37 + if(!c->isfloating) { 38 + wc.sibling = selmon->barwin; 39 + wc.stack_mode = Below; 40 + XConfigureWindow(dpy, c->win, CWSibling | CWStackMode, &wc); 41 + } 42 setfocus(c); 43 } 44 else 45 @@ -1227,7 +1237,7 @@ 46 if(n > 0) /* override layout symbol */ 47 snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); 48 for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) 49 - resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, False); 50 + resize(c, m->wx - c->bw, m->wy, m->ww, m->wh, False); 51 } 52 53 void 54 @@ -1744,13 +1754,16 @@ 55 for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) 56 if(i < m->nmaster) { 57 h = (m->wh - my) / (MIN(n, m->nmaster) - i); 58 - resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False); 59 - my += HEIGHT(c); 60 + if(n == 1) 61 + resize(c, m->wx - c->bw, m->wy, m->ww, m->wh, False); 62 + else 63 + resize(c, m->wx - c->bw, m->wy + my, mw - c->bw, h - c->bw, False); 64 + my += HEIGHT(c) - c->bw; 65 } 66 else { 67 h = (m->wh - ty) / (n - i); 68 - resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), False); 69 - ty += HEIGHT(c); 70 + resize(c, m->wx + mw - c->bw, m->wy + ty, m->ww - mw, h - c->bw, False); 71 + ty += HEIGHT(c) - c->bw; 72 } 73 } 74