xfce-mcs-manager -> suggest signal poll interval == 1s

Jasper Huijsmans jasper at xfce.org
Thu May 24 21:01:08 CEST 2007


Brian J. Tarricone wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Wed, 23 May 2007 23:47:53 -0700 Brian J. Tarricone wrote:
>> Actually, a better fix -- that would eliminate the polling completely
>> -- would be to have the signal handler write the status code to a
>> pipe, and then have the glib mainloop watch the pipe.  Pretty sure
>> writing to a pipe is one of the few things 'allowed' in a signal
>> handler...
> 
> And here's a patch.  It compiles; that's all I know.  Presumably it
> should work too.  If someone wants to test it, I'll commit it if it
> works (or someone else can).
> 

Looks a lot like what I did for the panel, but there are a few 
differences, and I have no idea if they are important, because, 
naturally, I just copied the code from some example ;-)


 From mcs-manager to panel:

- Check return value for write.
- Don't check condition in io watch callback.
- g_..._read_chars instead of g_..._read, with use of a union to get 
chars to int value. Looks overly complicated to me, actually... Ah, a 
comment says there is no ..._read, so this must be old.
- read pipe in a while loop, check at the end if status matches 
G_IO_STATUS AGAIN.
- Quit if pipe can't be created.
- Set reading and writing end of the pipe specifically to non-blocking mode.
- Use G_IO_IN | G_IO_PRI instead of just G_IO_IN.
- Don't unref channel.

Like I said, I have no idea if these changes are in any way important, 
or which version is 'better', if any. Just thought I'd mention it.

--
	Jasper



More information about the Xfce4-dev mailing list