Subject: Notification: incoming/1386

From: [email-masked]
Date: Sat, 7 Aug 2004 15:30:45 -0500 (CDT)

FVWM Bug Tracking notification

new message incoming/1386

Message summary for PR#1386
	From: [email-masked]
	Subject: fvwm-root --retain-pixmap removes old background even if invalid pixmap is given.
	Date: Sat, 7 Aug 2004 15:30:44 -0500
	0 replies 	0 followups

====> ORIGINAL MESSAGE FOLLOWS <====

>From [email-masked] Sat Aug 07 15:30:45 2004
Date: Sat, 7 Aug 2004 15:30:44 -0500
From: [email-masked]
To: [email-masked]
Subject: fvwm-root --retain-pixmap removes old background even if invalid pixmap is given.

Full_Name: Niv ALTIVANIK
Version: fvwm 2.5.10 compiled on May  8 2004 at 03:05:32
with support for: ReadLine, RPlay, Stroke, XPM, PNG, Shape, XShm, SM, Bidi text, Xinerama, XRender, XFT, NLS
CVS_Date: 
OS: Linux heiwa 2.6.8-rc2-mm2xa1 #1 Wed Aug 4 02:42:06 CEST 2004 ppc GNU/Linux
X_Server: XFree86 Version 4.3.0.1 (Debian 4.3.0.dfsg.1-6 20040709050738 [email-masked])
Submission from: (NULL) (81.57.55.19)

Calling fvwm-root --retain-pixmap with an invalid pixmap as argument
removes the old bacground, and replaces it by a grey one. This may be
voluntary, but i find the behaviour annoying.

To reproduce:
- set a wallpaper ( i.e. with fvwm-root --retain-pixmap /path/to/pixmap )
- call fvwm-root --retain-pixmap blah-invalid-name.

I'm just a begginer in C coding, but i've attached a solution ( read patch
) that seems to fix it.

Patch: 

diff -Nru fvwm-2.5.10-old/bin/fvwm-root.c fvwm-2.5.10/bin/fvwm-root.c
--- fvwm-2.5.10-old/bin/fvwm-root.c     2004-08-05 02:55:32.000000000
+0200
+++ fvwm-2.5.10/bin/fvwm-root.c 2004-08-05 02:55:49.000000000 +0200
@@ -21,7 +21,7 @@
 int screen;
 Window root;
 char *display_name = NULL;
-void SetRootWindow(char *tline);
+int SetRootWindow(char *tline);
 Pixmap rootImage = None;
 Bool NoDither = False;
 Bool Dither = False;
@@ -191,7 +191,7 @@
        }
        else
        {
-               SetRootWindow(argv[argc-1]);
+               if (SetRootWindow(argv[argc-1])) exit(1);
        }

        prop = XInternAtom(dpy, "_XSETROOT_ID", False);
@@ -253,7 +253,7 @@
 }

-void SetRootWindow(char *tline)
+int SetRootWindow(char *tline)
 {
        Pixmap shapeMask = None, temp_pix = None, alpha = None;
        int w, h, depth;
@@ -309,7 +309,7 @@
                fprintf(
                        stderr, "[fvwm-root] failed to load image file
'%s'\n",
                        tline);
-               return;
+               return -1;
        }
        if (depth == Pdepth)
        {
@@ -332,4 +332,5 @@
        XSetWindowBackgroundPixmap(dpy, root, rootImage);
        save_colors = 1;
        XClearWindow(dpy, root);
+       return 0;
 }

i hope this can help.

--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Sun, 8 Aug 2004 23:44:29 +0200

> I'm just a begginer in C coding, but i've attached a solution ( read patch

Thanks for the patch.  I have applied it to the latest fvwm
sources.

Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [email-masked]