xfce-exec

Brian J. Tarricone bjt23 at cornell.edu
Wed Mar 3 08:12:51 CET 2004


Jasper Huijsmans wrote:

>This is the command execution function for the panel with startup
>notification support, changed to make it suitable for general use. I
>intend to put this in libxfcegui4 (startup notification needs X support)
>if there are no objections. 
>
>So how does this look? 
>  
>
awesome.  i especially like how if you pass it a directory it will 
either open a terminal to the dir or open it using xftree4  (hehe, funny 
how that looks like XFree4... a _really_ old version of xfree86, perhaps?).

Benedikt Meurer wrote:

> Since this function is part of the public API of a xfce library, it 
> would be nice to have it prefixed with xfce_. Maybe 
> xfce_exec_free_startup_timeout() or xfce_exec_free_resources(), so one 
> knows that this belongs to the xfce-exec module when found in the source.

strongly agree.  (on my pedantic/anal days, i think we should do 
something clever like 'xfcegui_' and 'xfceutil_', but i think that's a 
bit much, and i'm a lazy typist anyway [lowercase letters, anyone?].)

> Another possibility would be to automatically register this function 
> with g_atexit() once, e.g. in xfce_exec:

for some reason i'm always leery of (g_)atexit()... i'm not sure why.  i 
am, however, definitely in favor of having the lib transparently do 
cleanup.  but as for having xfce_exec() automatically register with 
g_atexit(), the question remains: is there any instance where a user fo 
xfce_exec() wouldn't want this registration done?  if so, it either has 
to be configurable via another arg to xfce_exec() (which defeats the 
purpose about having the lib do it behind the scenes), or we just don't 
do it at all.  fortunately, as you've written it, if a dev wants to call 
(xfce_)free_startup_timeout() on their own, calling it again results in 
a no-op.

hmm, that's a toughie.  i personally can't think of any reason why you 
_wouldn't_ want to call it on exit, so making it a private function and 
automatically registering with g_atexit() may be fine.

the only issue, as benny mentions, is with gmodules...  i suppose the 
only way to find out is to try it ^_~.  i would imagine that, e.g., a 
panel plugin calling xfce_exec() would get the xfce_exec() mapped in the 
memory region of the panel itself (which is linked to libxfcegui4), so 
you wouldn't have a problem if the plugin gets unloaded.  but is this 
true on all platforms?  and if the panel plugin links with libxfcegui4 
on its own, will this create a problem (trivial solution, though, 
obviously).

    -brian




More information about the Xfce4-dev mailing list