Subject: FVWM: Another Bug in fvwm 2.0.41

From: Graham Barr <[email-masked]>
Date: Fri, 15 Mar 1996 14:44:19 +0000 (GMT)

I have found another bug/problem with fvwm 2.0.41. The problem lies in
fvwm.c when it opens,closes and then opens the deispaly again. Below
is a patch which fixes the problem

--- fvwm.c.orig	Mon Feb 19 14:57:42 1996
+++ fvwm.c	Fri Mar 15 14:41:55 1996
@@ -220,31 +220,31 @@
 
     strcpy(message, XDisplayString(dpy));
 
-    XCloseDisplay(dpy);
-
-    for(i=1;i<Scr.NumberOfScreens;i++)
+    for(i=0;i<Scr.NumberOfScreens;i++)
     {
-      if (fork() == 0)
+      if (i != Scr.screen && fork() == 0)
       {
         myscreen = i;
+
+        /*
+         * Truncate the string 'whatever:n.n' to 'whatever:n',
+         * and then append the screen number.
+         */
+        cp = strchr(message, ':');
+        if (cp != NULL)
+        {
+          cp = strchr(cp, '.');
+          if (cp != NULL)
+            *cp = '\0';		/* truncate at display part */
+        }
+        sprintf(message + strlen(message), ".%d", myscreen);
+        dpy = XOpenDisplay(message);
+        Scr.screen = myscreen;
+        Scr.NumberOfScreens = ScreenCount(dpy);
+
         break;
       }
     }
-    /*
-     * Truncate the string 'whatever:n.n' to 'whatever:n',
-     * and then append the screen number.
-     */
-    cp = strchr(message, ':');
-    if (cp != NULL)
-    {
-      cp = strchr(cp, '.');
-      if (cp != NULL)
-        *cp = '\0';		/* truncate at display part */
-    }
-    sprintf(message + strlen(message), ".%d", myscreen);
-    dpy = XOpenDisplay(message);
-    Scr.screen = myscreen;
-    Scr.NumberOfScreens = ScreenCount(dpy);
   }
 
   x_fd = XConnectionNumber(dpy);

--
Graham Barr <[email-masked]>
Texas Instruments Ltd.

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