Attached is a unified patch against tip for hiding the border of clients when 
in monocle mode. A border is still drawn when in tiled mode, even if there's 
only one client visible. That's unuseful but as a passive reminder of the 
current mode. This behaviour is a compromise stemming from the border drawing 
handler being less accessible.

The patch is makes the same change to both resizeclient() and configure(). This 
is especially awkward considering that resizeclient() calls configure().
diff -r c794a9f5ae5e -r fcdacab99af2 config.def.h
--- a/config.def.h	Sun Jul 08 09:45:53 2012 +0200
+++ b/config.def.h	Mon Oct 22 21:17:23 2012 +0000
@@ -33,9 +33,9 @@
 
 static const Layout layouts[] = {
 	/* symbol     arrange function */
-	{ "[]=",      tile },    /* first entry is default */
-	{ "><>",      NULL },    /* no layout function means floating behavior */
-	{ "[M]",      monocle },
+	{ True,  "[]=",      tile },    /* first entry is default */
+	{ True,  "><>",      NULL },    /* no layout function means floating behavior */
+	{ False, "[M]",      monocle },
 };
 
 /* key definitions */
diff -r c794a9f5ae5e -r fcdacab99af2 config.mk
--- a/config.mk	Sun Jul 08 09:45:53 2012 +0200
+++ b/config.mk	Mon Oct 22 21:17:23 2012 +0000
@@ -21,7 +21,7 @@
 # flags
 CPPFLAGS = -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
 #CFLAGS   = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
-CFLAGS   = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
+CFLAGS   = ${CPPFLAGS}
 LDFLAGS  = -s ${LIBS}
 
 # Solaris
@@ -29,4 +29,4 @@
 #LDFLAGS = ${LIBS}
 
 # compiler and linker
-CC = cc
+CC = tcc
diff -r c794a9f5ae5e -r fcdacab99af2 dwm.c
--- a/dwm.c	Sun Jul 08 09:45:53 2012 +0200
+++ b/dwm.c	Mon Oct 22 21:17:23 2012 +0000
@@ -121,6 +121,7 @@
 } Key;
 
 typedef struct {
+	Bool showborder;
 	const char *symbol;
 	void (*arrange)(Monitor *);
 } Layout;
@@ -479,7 +480,7 @@
 void
 cleanup(void) {
 	Arg a = {.ui = ~0};
-	Layout foo = { "", NULL };
+	Layout foo = { True, "", NULL };
 	Monitor *m;
 
 	view(&a);
@@ -564,7 +565,10 @@
 	ce.y = c->y;
 	ce.width = c->w;
 	ce.height = c->h;
-	ce.border_width = c->bw;
+	if(c->mon->lt[c->mon->sellt]->showborder)
+		ce.border_width = c->bw;
+	else
+		ce.border_width = 0;
 	ce.above = None;
 	ce.override_redirect = False;
 	XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce);
@@ -1367,7 +1371,10 @@
 	c->oldy = c->y; c->y = wc.y = y;
 	c->oldw = c->w; c->w = wc.width = w;
 	c->oldh = c->h; c->h = wc.height = h;
-	wc.border_width = c->bw;
+	if(c->mon->lt[c->mon->sellt]->showborder)
+		wc.border_width = c->bw;
+	else
+		wc.border_width = 0;
 	XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
 	configure(c);
 	XSync(dpy, False);

Reply via email to