[hackers] [2wm][PATCH] Expose root window color in config.default.h

From: Harry van Haaren <harryhaaren_AT_gmail.com>
Date: Tue, 19 Jan 2016 20:23:41 +0000

---
 config.default.h | 1 +
 main.c           | 4 +++-
 view.c           | 4 ++--
 3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/config.default.h b/config.default.h
index 8a8d56f..6e21be2 100644
--- a/config.default.h
+++ b/config.default.h
_AT_@ -5,6 +5,7 @@
 #define BORDERPX		1
 #define NORMCOLOR		"#333"
 #define SELCOLOR		"#69c"
+#define ROOTCOLOR		"#333"
 
 #define SY			0
 #define SH			DisplayHeight(dpy, screen)
diff --git a/main.c b/main.c
index cb783c2..f32b238 100644
--- a/main.c
+++ b/main.c
_AT_@ -152,6 +152,8 @@ main(int argc, char *argv[]) {
 		eprint("2wm: cannot open display\n");
 	screen = DefaultScreen(dpy);
 	root = RootWindow(dpy, screen);
+	XSetWindowBackground(dpy, root, getcolor(ROOTCOLOR));
+	XClearWindow(dpy, root);
 	otherwm = False;
 	XSetErrorHandler(xerrorstart);
 	/* this causes an error if some other window manager is running */
_AT_@ -212,7 +214,7 @@ main(int argc, char *argv[]) {
 	XSync(dpy, False);
 
 	while(running) {
-	 	XNextEvent(dpy, &ev);
+		XNextEvent(dpy, &ev);
 		if(handler[ev.type])
 			(handler[ev.type])(&ev); /* call handler */
 	}
diff --git a/view.c b/view.c
index 1c9e298..d11f4e2 100644
--- a/view.c
+++ b/view.c
_AT_@ -49,7 +49,7 @@ pop(Client *c) {
 static void
 togglemax(Client *c) {
 	XEvent ev;
-		
+
 	if(c->isfixed)
 		return;
 
_AT_@ -145,7 +145,7 @@ detach(Arg *arg) {
 void
 focusnext(Arg *arg) {
 	Client *c;
-   
+
 	if(!sel)
 		return;
 	if(!(c = getnext(sel->next)))
-- 
2.5.0
Received on Tue Jan 19 2016 - 21:23:41 CET

This archive was generated by hypermail 2.3.0 : Tue Jan 19 2016 - 21:24:12 CET