How to detect DBus dying

Tony Houghton h at
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
<>, 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(
    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

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 *

More information about the dbus mailing list