Subject: Wait function fails at startup/re-startup: Server grabbing timing ?

From: Makoto MATSUSHITA <[email-masked]>
Date: Mon, 20 Jan 1997 16:00:33 +0900

'Wait' built-in function is broken in 2.0.44 when it is used as in a
'InitFunction' or 'RestartFunction', i.e., fvwm startup. I've hacked
the fvwm soruce code, and found it is a timing problem of grabbing server.

In a patch of <[email-masked]>, XGrabServer()
timing in main() function is changed. However, I move MyXGrabServer()
line, 'Wait' built-in function works well.

Anyway, this is a patch.

--- fvwm/fvwm.c.dist	Tue Jan 14 23:06:33 1997
+++ fvwm/fvwm.c	Mon Jan 20 15:57:32 1997
@@ -352,8 +352,6 @@
 
   XSetErrorHandler((XErrorHandler)FvwmErrorHandler);
 
-  MyXGrabServer(dpy);
-
   BlackoutScreen(); /* if they want to hide the capture/startup */
 
   CreateCursors();
@@ -454,6 +452,8 @@
 #ifndef NON_VIRTUAL
   initPanFrames();
 #endif
+
+  MyXGrabServer(dpy);
 
 #ifndef NON_VIRTUAL
   checkPanFrames();

I think this timing change is maybe nessesary to handle style
attributes, so this fix is not good. Hmm, what should we do ?

-- -
Makoto `MAR_kun' MATSUSHITA
--
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: Mon, 20 Jan 1997 11:00:43 -0500

>>>>> "MM" == Makoto MATSUSHITA <[email-masked]> writes:

MM> 'Wait' built-in function is broken in 2.0.44 when it is used as in a
MM> 'InitFunction' or 'RestartFunction', i.e., fvwm startup. I've hacked
MM> the fvwm soruce code, and found it is a timing problem of grabbing server.

MM> In a patch of <[email-masked]>, XGrabServer()
MM> timing in main() function is changed. However, I move MyXGrabServer()
MM> line, 'Wait' built-in function works well.

MM> Anyway, this is a patch.
....
MM> I think this timing change is maybe nessesary to handle style
MM> attributes, so this fix is not good. Hmm, what should we do ?

If I remember correctly, I moved that further up between 2.0.43 and
2.0.44 thinking that it might help with the startup problem (with
missing the style stuff, etc), but looking at it again right now it
probably makes little difference (since the recapture function is also
grabbing the server and that is probably where it really makes a
difference).

So, I think your patch is correct (removes my blunder).

I'll look it over some more, and I'd like to hear back from people
about whether or not this patch works for them and doesn't break
anything else.

Chuck