using dbus in the platform

Havoc Pennington hp at redhat.com
Fri Sep 28 08:49:16 PDT 2007


Hi,

Various bits of the GNOME platform are ending up "off to the side" or
not integrated into gtk properly due to the dbus dependency.

(previously whining about this at
http://lists.freedesktop.org/archives/dbus/2007-August/008238.html)

Examples of features that do or could use dbus, which should be
gtk-integrated: single instance, notification bubbles, dconf, "session
management" (or rather distinct sub-problems that get labeled that),
launching the help viewer.

I want to propose moving forward on this front. Here is a strawman approach.

1) Create a GLib main loop integration library, separate from
dbus-glib (dbus-glib should now depend on this main loop integration
library). Note the distinction between a "framework integration" of
libdbus, and an "object system mapping." The idea here is punt on
object system mapping for now (let it keep evolving), but have a small
framework integration lib. Concretely, this is
dbus_connection_setup_with_g_main() and not a lot else.

See this thread:
http://lists.freedesktop.org/archives/dbus/2007-September/008575.html

2) GTK+ has a dependency on dbus, on X11 only, for "desktop
integration" features to work. (See list of examples above.) By
"dependency" I mean specifically:
 - dbus.h is not included in gtk.h
 - gtk or gdk contains interfaces such as settings, notifications,
single instance, launch help viewer; on X11, these are implemented
using libdbus (suggest a cut-and-paste of hippo-dbus-helper.[hc] or
equivalent is used internal to gtk)
 - on Windows and OS X, these interfaces are implemented in some
native way (though it could make sense to rely on a dbus port in some
cases, I don't know)

3) Apps that want to use dbus for custom IPC would choose an object
system mapping (such as dbus-glib) and use it, or just use libdbus
directly, but gtk would not be involved - for now no object system
mapping is blessed


Idea here is to recognize that:
 - gtk should use desktop integration points on each platform
 - the desktop integration points on Linux use dbus as the mechanism
 - this is really just blocking on making some decisions, not on a ton of work

A simple way to get this in place would be to replace the "show help"
thing from libgnomeui. There should be little new API or controversy
there, so all the work would be just getting the dbus setup in place.

Question for GTK maintainers, if nobody has a better approach than the
above, is how to structure the code; i.e. taking the help example,
where does the "linux dbus" implementation of it live in the source
tree, where does the Windows implementation live, how is it
conditionalized, etc.

Havoc


More information about the dbus mailing list