Subject: PATCH: 2.0.43 (was: Another Bug in fvwm 2.0.41)

From: Graham Barr <[email-masked]>
Date: Wed, 10 Jul 96 13:10:47 BST

Back in March I posted 2 patches for fvwm 2.0.41, the details are listed
below. I have just pulled and built fvwm 2.0.43 and noticed that these patches
were not included, so I am posting them again.

This patch was created on 2.0.41 and still applies cleanly to 2.0.43

Graham Barr <[email-masked]> writes:
>Hi,
>   I have just started looking at convering to fvwm2 and I am very please
>with it. But I do have a small bug to report. It happens when I try to
>start an application iconic and also specify where to place the icon
>
>For example
>
> xterm  -xrm  '*iconGeometry: +940+0' -iconic 
>
>
>fvwm2 first places the icon ar (0,0) then moves it to the required location
>(940,0). However if the location (0,0) is completely obscured by another
>window fvwm2 does not move the icon to the required location until the
>icon at (0,0) is exposed in some way, like closing the window which
>is obscuring it.
>
>I tracked this to a line of code in events.c, here is a patch which fixes
>the problem by initially placing the icon at the wmhints location instead of
>(0,0)

Graham Barr <[email-masked]> writes:
>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 dispaly again. Below
>is a patch which fixes the problem

--- events.c.orig	Thu Mar 14 13:50:44 1996
+++ events.c	Thu Mar 14 13:52:58 1996
@@ -765,7 +765,14 @@
 	  break;
 	  
 	case IconicState:
-	  Iconify(Tmp_win, 0, 0);
+	  if (Tmp_win->wmhints)
+	    {
+	      Iconify(Tmp_win, Tmp_win->wmhints->icon_x, Tmp_win->wmhints->icon_y);
+	    }
+	  else
+	    {
+	      Iconify(Tmp_win, 0, 0);
+	    }
 	  break;
 	}
       if(!PPosOverride)
--- 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]>   | There is no ultimate answer.
Texas Instruments Ltd.           | Only more revealing ways
                                 | of looking at the question.

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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: "Charles Hines" <[email-masked]>
Date: Wed, 10 Jul 1996 08:56:27 -0400

>>>>> "Graham" == Graham Barr <[email-masked]> writes:

Graham> Back in March I posted 2 patches for fvwm 2.0.41, the details
Graham> are listed below. I have just pulled and built fvwm 2.0.43 and
Graham> noticed that these patches were not included, so I am posting
Graham> them again.

I had meant to get those into 2.0.43, but it slipped my mind in my
final rush to get it out the door.  These will be in 2.1.0.

Chuck