xfrun and dbus

Jani Monoses jani.monoses at gmail.com
Fri Mar 10 10:21:36 CET 2006


> 
> Cool, thanks.  I'm not sure if we want to link xfrun to dbus - I'll let
> someone else debate that.

It is a minimal dependency as far as footprint and startup time are 
concerned, but I made it optional just in case this is an issue.
> 
> Personally I'd rather see two binaries, which unfortunately share much
> of the same dialog code (best would be to stick it in a static library).

That's the main reason I did not split in two binaries as in the first 
version I posted. The code reorg in setup_ui /show_ui could need some 
more cleanup and probably better function names, but it is pretty 
straightforward now.

>  'xfrun4-daemon' just runs as a daemon, provides a dbus service, and
> shows the dialog as necessary.  'xfrun4' does not link with dbus, and
> tries to use 'dbus-send' to launch a dialog, and then presents a
> non-daemon run dialog if that fails.  (Can dbus-send report failure?)  I
> think Benny had some thoughts on this; I don't recall exactly.
> 
the problem with dbus-send would be that invoking it would impact 
startup time more than an already linked in lib.
Also this could be achieved right now with binding a hotkey to dbus-send 
directly :)

> One thing that needs to be fixed though for inclusion: the --daemon
> implementation is not correct.  If the user runs that from a terminal,
> xfrun will quit when the terminal is closed.  The best way is to check
> for the presence of the daemon() libc call, and if that's not present,
> use fork() and setsid(), and run the daemon in the child process, while
> the parent quits with _exit() (note the leading underscore).
> 
That --daemon is a misnomer I think :). I did not really intend to make 
a real unix daemon, so it may have to be changed to xfrun4 --listen 
(even though that makes one think of daemons too). If it is closed no 
problem; since it is registered with dbus it will be started on request. 
A lot simpler IMHO than doing a proper daemon for little gain.

What needs to be thinked of is how best to integrate it with the 
session: autostart or session client? It can be called from xinitrc
but I am not sure what is needed to make it go away if the session is 
closed. It may even do that automatically if dbus session daemon dies.

I need to understand these a bit more.

Jani




More information about the Xfce4-dev mailing list