GDBus: try XDG_RUNTIME_DIR/bus before resorting to dbus-launch
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 15 Apr 2015 16:57:29 +0000 (17:57 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 9 Jun 2015 17:17:16 +0000 (18:17 +0100)
commit32492c6ab0000c50564360c74acf069814d942d1
tree9134835e4b4b168fcfd6efdf710b39b435e72b42
parent0d3f56e31c9099653539fa2539e05b3ba336a441
GDBus: try XDG_RUNTIME_DIR/bus before resorting to dbus-launch

This is the right thing to do for the "a session is a user-session"
model implemented in dbus 1.9.14, which is described in
<http://lists.freedesktop.org/archives/dbus/2015-January/016522.html>.

It also resembles sd-bus' behaviour, although sd-bus will only try
kdbus and XDG_RUNTIME_DIR/bus, and never runs dbus-launch.

On systems following the more traditional "a session is a login-session"
model, X_R_D/bus won't exist, so it is harmless to check for it before
falling back to X11 autolaunching. Again, this matches the behaviour
of current libdbus and sd-bus versions.

Now that we do this, g_test_dbus_unset() needs to clear XDG_RUNTIME_DIR
as well as everything else.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=747941
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
gio/gdbusaddress.c
gio/gtestdbus.c