[Xfce-bugs] [Bug 1598] Implement D-BUS support for xfrun4

bugzilla-daemon at xfce.org bugzilla-daemon at xfce.org
Fri Apr 21 10:48:36 CEST 2006


Do NOT reply to this email.  To make further comments on this bug, use
the URL below:
http://bugzilla.xfce.org/show_bug.cgi?id=1598


bjt23 at cornell.edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




------- Comment #8 from bjt23 at cornell.edu  2006-04-21 08:48 UTC -------
All right, finally getting a chance to look at this.  We have two options here:

1.  I give my comments and someone fixes the patch until I'm happy.
2.  I take what we have now and fix it myself.

#2 might take a while, because I'm busy.  So I'll proceed assuming #1, and if I
happen to get to it before someone else does, that's fine too.

The problems:

1.  Use my coding style.  4-space indents, no tabs at all.  Braces on the same
if/else/while/for line.  No extra indents for braces.  Braces for function
definitions go on the next line.  No spaces between function calls and the
opening parenthesis.  Same thing for if/else/while/for.

2.  Chill out on the comments.  No need to comment virtually every single line
of code.  If "xfrun_dialog_show(dialog);" isn't obvious enough, we have a
problem.

3.  Daemon mode:  First try to use the daemon() libc call (check for it in
configure.ac first).  If we don't have that, fork(), and the child calls
setsid() and becomes the daemon process, while the parent just _exit()s (note
the leading underscore on _exit).

4.  Daemon mode should be the default.  The --no-daemon option will give the
old behavior.  Obviously, if we don't HAVE_DBUS, or connecting to the session
bus fails, we just display the dialog and exit afterwards.

5.  This I can do myself, but so I remember: now that we're doing daemon mode,
let's ditch the crap I yanked out of libxfcegui4 (etc.) to make the code size
slightly smaller.  We can live with the extra teeny amount of time to link to
libgui.

This is extra credit.  I may do it myself after the rest of the patch is done:

6.  Break the functionality into two binaries: xfrun4 and xfrun4-daemon (which
gets put in $(libexecdir)).  Assuming DBUS is present, xfrun4 tries to see if
the service is available, and if not, fork()s and exec()s xfrun4-daemon, and
exits; if the service is available, it just calls it.  xfrun4-daemon also needs
a commandline switch to not run as a daemon, so xfrun4 can launch xfrun4-daemon
to show the dialog if DBUS isn't available, or if the user passes --no-daemon
to xfrun4.
(Hell, if we could assume DBUS is always available, xfrun4 could be a bash
script.  Oh well.)

This #6 might be a bit much for now: it's easier and less error-prone to just
do it with one binary, and I'd rather not add risk since we're in beta.


-- 
Configure bugmail: http://bugzilla.xfce.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the Xfce-bugs mailing list