Subject: FvwmConsole to FvwmConsoleC communication

From: Dominik Vogt <[email-masked]>
Date: Sat, 10 Mar 2001 17:14:32 +0100

FvwmConsoleC (client process) and FvwmConsole (server process)
seem to have a problem with their pipe communication.  To
reproduce the problem:

1) Write a file ~/.fvwm/bug:

---------------- snip -------------------
DestroyFunc InitializeDecor
AddToFunc InitializeDecor
+ I DestroyDecor $0
+ I AddToDecor $0
+ I +   TitleStyle RightJustified
+ I +   ButtonStyle All ActiveUp (-- flat) Inactive (-- flat)
+ I +   ButtonStyle All -- UseTitleStyle
+ I +   ButtonStyle 4 8 70x10@0 30x10@0 30x50@0 10x50@0 50x90@0 90x50@1  70x50@1 70x10@1
+ I +   ButtonStyle 1 13 90x10@0 10x10@0 10x20@0 50x20@1 10x60@0 30x60@0 30x90@0 70x90@1 70x60@1 90x60@1 50x20@1 90x20@1 90x10@1
+ I +   ButtonStyle 2 8 50x10@0 10x50@0 30x50@0 30x90@0 70x90@1 70x50@1 90x50@1 50x10@1
+ I +   TitleStyle -- flat
+ I +   BorderStyle -- HiddenHandles NoInset

Function InitializeDecor AtermDecor
AddToDecor AtermDecor
+       TitleStyle HGradient 128 DeepSkyBlue4 black
Style AtermStyle UseDecor AtermDecor, Color white/grey50, HilightFore white
---------------- snip -------------------

2) Open an FvwmConsole window.

3) Type "read bug" into that window.

4) Put the first three lines of the file into the cut buffer.

     DestroyFunc InitializeDecor
     AddToFunc InitializeDecor
     + I DestroyDecor $0

   Be sure to include the newlines.

5) Paste all lines at once into the Fvwmconsole window.

6) Repeat steps 3 to 5 until error messages show up:

     [FVWM][execute_function]: <<ERROR>> Command can not be added to a decor; executing command now: 'I DestroyDecor'
     ...

   This may take a few attempts until it shows up.

The reason for the error message is that the
"AddToFunc InitializeDecor" line was sent from FvwmConsoleC to
FvwmConsole, but FvwmConsole never received that line and thus
never sent it to fvwm.  Therefore fvwm is still adding things to
the AtermDecor from the pass through the read command.

The corresponding code from FvwmConsoleC looks like this (around
line 103):

	  /* send the command including null to the server */
	  send( s, cmd, strlen(cmd)+1, 0 );

The problem goes away if I add a usleep(1) before the send():

	  /* send the command including null to the server */
	  usleep(1);
	  send( s, cmd, strlen(cmd)+1, 0 );

Of course this is not a proper fix, but I don't have a clue whet
the problem is in the first place.  Help!

Bye

Dominik ^_^  ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
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]