usrlib.de / CVS

Diff for revision 1.13 of bgset/bgset.c

--- //cvs/lukas/bgset/bgset.c	2016/09/05 23:08:50	1.12
+++ //cvs/lukas/bgset/bgset.c	2016/09/06 00:46:55	1.13
@@ -180,11 +180,6 @@
 
 	x_init(&dpy, &scr, &root, &info, &scrnum);
 
-	/* default screen dimensions */
-	x = y = 0;
-	w = DisplayWidth(dpy, scr);
-	h = DisplayHeight(dpy, scr);
-
 	/* parse command line and draw images */
 	for (i = 0; i < scrnum; i++) {
 		if ((opt = getopt(argc, argv, "c:C:t:T:s:S:f:F:n")) == -1) {
@@ -217,10 +212,16 @@
 		}
 
 		if (info && opt >= 'a') {
+			/* Xinerama screen */
 			x = info[i].x_org;
 			y = info[i].y_org;
 			w = info[i].width;
 			h = info[i].height;
+		} else {
+			/* default screen dimensions: entire display area */
+			x = y = 0;
+			w = DisplayWidth(dpy, scr);
+			h = DisplayHeight(dpy, scr);
 		}
 
 		if (!(draw_image(dpy, scr, root, optarg, mode, x, y, w, h))) {