usrlib.de / CVS

Diff for revision 1.27 of bgset/bgset.c

--- //cvs/lukas/bgset/bgset.c	2017/11/18 23:04:34	1.26
+++ //cvs/lukas/bgset/bgset.c	2018/03/23 18:59:51	1.27
@@ -1,6 +1,6 @@
 /*
  * bgset
- * Copyright (c) 2016, 2017 Lukas Hofmann <lhofmann@fsfe.org>
+ * Copyright (c) 2016 - 2018 Lukas Hofmann <lukas@usrlib.de>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -129,7 +129,10 @@
 	Window root;
 	Pixmap pxm;
 	GC gc;
-	XGCValues gc_val = { .background = 0 };
+	XGCValues gc_val = {
+	    .foreground = BlackPixel(dpy, scr),
+	    .fill_style = FillSolid
+	};
 
 	/* get current background pixmap */
 	root = DefaultRootWindow(dpy);
@@ -161,8 +164,9 @@
 	if (!data) {
 		pxm = XCreatePixmap(dpy, root, dpy_w, dpy_h,
 		    DefaultDepth(dpy, scr));
-		gc = XCreateGC(dpy, pxm, (1L<<3), &gc_val);
+		gc = XCreateGC(dpy, pxm, 1L<<3 || 1L<<8, &gc_val);
 		XDrawRectangle(dpy, pxm, gc, 0, 0, dpy_w, dpy_h);
+		XFillRectangle(dpy, pxm, gc, 0, 0, dpy_w, dpy_h);
 		XFreeGC(dpy, gc);
 	}