On Sat, Mar 27, 2010 at 06:27:52PM -0400, Jeremiah Dow wrote:
>    If anyone else is interested in this kind of border handling - this is
>    my patch.
> 
>    Not quite the same behavior as Sean's - I just wanted to set the border
>    width to zero anytime there was only one client visible, so only need
>    to add two lines to the tile function.
> 
>    I use this on a laptop, but it should work just as well with multiple
>    monitors.
> 
>    Jeremiah

Hello,
thanks for this patch, i like this behavior,
I took your patch as a base and i just added to it one line
in monocle function because i had a few issue when toggling tile/monocle
(it wasn't working anymore, don't know why)
with this line i don't have the issue anymore
and monocle is handled as well.

Julien
diff -up a/dwm.c b/dwm.c
--- a/dwm.c	2010-04-02 15:44:34.000000000 +0200
+++ b/dwm.c	2010-04-02 15:44:19.000000000 +0200
@@ -1130,7 +1130,7 @@ manage(Window w, XWindowAttributes *wa)
 		/* only fix client y-offset, if the client center might cover the bar */
 		c->y = MAX(c->y, ((c->mon->by == 0) && (c->x + (c->w / 2) >= c->mon->wx)
 		           && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my);
-		c->bw = borderpx;
+		c->bw = 0;
 	}
 	wc.border_width = c->bw;
 	XConfigureWindow(dpy, w, CWBorderWidth, &wc);
@@ -1183,8 +1183,10 @@ monocle(Monitor *m) {
 			n++;
 	if(n > 0) /* override layout symbol */
 		snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
-	for(c = nexttiled(m->clients); c; c = nexttiled(c->next))
+	for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) {
+		c->bw = 0; 
 		resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, False);
+	}
 }
 
 void
@@ -1617,6 +1619,7 @@ tile(Monitor *m) {
 	/* master */
 	c = nexttiled(m->clients);
 	mw = m->mfact * m->ww;
+	c->bw = (n > 1 ? borderpx : 0);
 	resize(c, m->wx, m->wy, (n == 1 ? m->ww : mw) - 2 * c->bw, m->wh - 2 * c->bw, False);
 	if(--n == 0)
 		return;
@@ -1628,6 +1631,7 @@ tile(Monitor *m) {
 	if(h < bh)
 		h = m->wh;
 	for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) {
+		c->bw = borderpx;
 		resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n)
 		       ? m->wy + m->wh - y - 2 * c->bw : h - 2 * c->bw), False);
 		if(h != m->wh)

Reply via email to