aboutsummaryrefslogtreecommitdiff
path: root/libindicator/indicator-service.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-11-02 16:08:04 -0600
committerTed Gould <ted@canonical.com>2009-11-02 16:08:04 -0600
commitddb2ab7cba0d8b2c7ea5171595e06c04520f4b81 (patch)
tree68d5d56afd75d7f9dfc00c3a9dd34757f90b0e81 /libindicator/indicator-service.c
parent5e5f49521da190319a54ee5a7d18f9b824823027 (diff)
downloadlibayatana-indicator-ddb2ab7cba0d8b2c7ea5171595e06c04520f4b81.tar.gz
libayatana-indicator-ddb2ab7cba0d8b2c7ea5171595e06c04520f4b81.tar.bz2
libayatana-indicator-ddb2ab7cba0d8b2c7ea5171595e06c04520f4b81.zip
Adding a fallback to the session bus after trying the starter bus.
Diffstat (limited to 'libindicator/indicator-service.c')
-rw-r--r--libindicator/indicator-service.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c
index 4cc99d2..ff0bd03 100644
--- a/libindicator/indicator-service.c
+++ b/libindicator/indicator-service.c
@@ -116,14 +116,24 @@ indicator_service_init (IndicatorService *self)
/* Start talkin' dbus */
GError * error = NULL;
- DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
+ DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_STARTER, &error);
if (error != NULL) {
- g_error("Unable to get session bus: %s", error->message);
+ g_error("Unable to get starter bus: %s", error->message);
g_error_free(error);
- return;
+
+ /* Okay, fine let's try the session bus then. */
+ /* I think this should automatically, but I can't find confirmation
+ of that, so we're putting the extra little code in here. */
+ error = NULL;
+ bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
+ if (error != NULL) {
+ g_error("Unable to get session bus: %s", error->message);
+ g_error_free(error);
+ return;
+ }
}
- priv->dbus_proxy = dbus_g_proxy_new_for_name_owner(session_bus,
+ priv->dbus_proxy = dbus_g_proxy_new_for_name_owner(bus,
DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS,
DBUS_INTERFACE_DBUS,
@@ -134,7 +144,7 @@ indicator_service_init (IndicatorService *self)
return;
}
- dbus_g_connection_register_g_object(session_bus,
+ dbus_g_connection_register_g_object(bus,
INDICATOR_SERVICE_OBJECT,
G_OBJECT(self));