Re: LibUnique as blessed dependency



Hi,

Elijah Newren wrote:
I think you're still mostly ignoring a big part of the puzzle.  IMO,
D-Bus (as it exists today) is not a complete solution for this
problem.  I do not recall yet seeing an application author of a
single-instance application (whether they used D-Bus, X, bonobo,
bacon, or something else) try to handle startup-notification on their
own and get it right.  Maybe there was such a case and I missed it or
forgot it, but I've seen dozens of apps get it wrong in various ways
and plenty of others just not even attempt to get things right.

I don't mean to ignore this - I agree it's needed and "the hard part"

We did basically have this thread before I guess, I just dug out of Google my post saying the same thing I said this time, more or less:
http://mail.gnome.org/archives/desktop-devel-list/2006-September/msg00470.html

It would be nice IMO to go ahead and create a wiki page documenting the D-Bus interface - the Launch() thing or equivalent, and if it has a dict of properties, what the major properties are (in particular the DISPLAY, uris-to-open, and startup-notification-related properties).

I think it's important for libunique to 'look right' at the raw dbus protocol level as I talked about in that September post. I'm not quite sure where to find the latest libunique code? Google is not turning it up.

The multiple backends, IMO, are just historical cruft from libgunique.

Thanks, this is good news. Avoiding extra complexity is always a plus!

To have a discussion topic at GUADEC I started poking at a "dbus convenience library" called "gbus" that is a different angle from the various current language bindings - rather than focusing on the Object<->IPC mapping and wrapping dbus/dbus.h, it just includes dbus/dbus.h wholesale and adds convenience API for things like:
 - tracking bus name owners as they come and go
 - tracking clients using an interface you provide, so you can exit when
   none are left
 - handling of bus names you own, providing the "be sure there is one of
   me" part of single instance but not the "startup notification etc."
   part
 - tracking the bus itself as it comes and goes, in case you want to
   get ambitious and handle system bus restart
This is based on hippo-dbus-helper.c which is used in the mugshot client and local-export-daemon. I'll post code sometime during GUADEC probably, I have to finish packing at the moment.

Anyway, something like this (aside from being needed so dbus can be used from C without writing a ton of code), would make the IPC part of single instance super easy.

The part that would remain, of course, is the gtk stuff - parsing the environment and command line options from the binary that was launched into some serializable form, and then unpacking that and doing the right magic to open on the right screen with the right startup notification in the binary that owns the single instance.

Havoc



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]