Libxfce4ui spawn api break

Brian J. Tarricone brian at
Sun Nov 1 23:58:28 CET 2009

Hash: SHA1

On 11/01/2009 02:41 PM, Nick Schermer wrote:
> It turns out returning the pid is not useful, because you can create
> only 1 child watch per pid and we already need a child watch for
> handling startup notification.
> I though about adding a GChildWatchFunc and gpointer, which could be
> called from the child watch we connect, but then there is not way to
> disconnect the function, so that is not really a solution either.

Oh hmm, yeah, that kinda sucks.  Stupid glib.

Well, I guess it depends on how much work you want to do...  We could
create a xfce_add_child_watch() that *does* allow more than one child
watch (just store a list of callbacks in a hash table keyed by pid), and
put that in libxfce4util.

Not sure that's really a good idea, though... I hate adding new API for
a one-off need.

Your approach sounds fine, though as you suggest, you'd have to add
extra API to allow disconnecting the child watch function (and again,
you'd have to keep track of a pid->callback mapping anyway).

So I dunno, maybe the xfce_add_child_watch()/xfce_remove_child_watch()
idea is a better one?  It's at least cleaner and more generic, but it
might be a little over-engineered/bloaty/crack-like.   Hmm...

Version: GnuPG v2.0.11 (GNU/Linux)


More information about the Xfce4-dev mailing list