sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

dwm-6.0-singularborders.diff (1629B)


      1 --- dwm.c.orig	2013-03-23 15:13:21.709978427 +0100
      2 +++ dwm.c	2013-03-23 15:13:13.366645236 +0100
      3 @@ -842,6 +842,8 @@
      4  
      5  void
      6  focus(Client *c) {
      7 +	XWindowChanges wc;
      8 +
      9  	if(!c || !ISVISIBLE(c))
     10  		for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext);
     11  	/* was if(selmon->sel) */
     12 @@ -856,6 +858,11 @@
     13  		attachstack(c);
     14  		grabbuttons(c, True);
     15  		XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
     16 +		if(!c->isfloating) {
     17 +			wc.sibling = selmon->barwin;
     18 +			wc.stack_mode = Below;
     19 +			XConfigureWindow(dpy, c->win, CWSibling | CWStackMode, &wc);
     20 +		}
     21  		setfocus(c);
     22  	}
     23  	else
     24 @@ -1200,7 +1207,7 @@
     25  	if(n > 0) /* override layout symbol */
     26  		snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
     27  	for(c = nexttiled(m->clients); c; c = nexttiled(c->next))
     28 -		resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, False);
     29 +		resize(c, m->wx - c->bw, m->wy, m->ww, m->wh, False);
     30  }
     31  
     32  void
     33 @@ -1717,13 +1724,16 @@
     34  	for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
     35  		if(i < m->nmaster) {
     36  			h = (m->wh - my) / (MIN(n, m->nmaster) - i);
     37 -			resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False);
     38 -			my += HEIGHT(c);
     39 +			if(n == 1)
     40 +				resize(c, m->wx - c->bw, m->wy, m->ww, m->wh, False);
     41 +			else
     42 +				resize(c, m->wx - c->bw, m->wy + my, mw - c->bw, h - c->bw, False);
     43 +			my += HEIGHT(c) - c->bw;
     44  		}
     45  		else {
     46  			h = (m->wh - ty) / (n - i);
     47 -			resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), False);
     48 -			ty += HEIGHT(c);
     49 +			resize(c, m->wx + mw - c->bw, m->wy + ty, m->ww - mw, h - c->bw, False);
     50 +			ty += HEIGHT(c) - c->bw;
     51  		}
     52  }
     53