How to detect DBus dying

Tony Houghton h at realh.co.uk
Thu Sep 29 11:05:44 PDT 2005


I'm trying to update ROX-Session to work with recent versions of DBus
and I think I found a bug in the glib bindings
<https://bugs.freedesktop.org/show_bug.cgi?id=4637>, which means I can't
use dbus_g_proxy_new_for_peer. I'd like to be able to work around the
problem in ROX-Session so it can be used eg with Ubuntu 5.10 without
having to replace the dbus packages with a patched version.

ROX-Session includes, effectively, this bit of code:

    /* Get notified when the bus dies */
    local = dbus_g_proxy_new_for_peer(
            dbus_connection_glib,
            DBUS_PATH_LOCAL, DBUS_INTERFACE_LOCAL);
    g_signal_connect(G_OBJECT(local), "destroy",
            G_CALLBACK(lost_connection), NULL);

Is there a better way to detect DBus dying or can I just replace the
call with dbus_g_proxy_new_for_name? If so, what should I use as the
name?

If I shouldn't be doing this at all I guess it's OK to remove that code
altogether, because it considers the condition fatal anyway and all
lost_connection() does is to clear the application's reference to the
connection and warn the user to restart the X session.

-- 
TH * http://www.realh.co.uk


More information about the dbus mailing list