aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/indicator-session.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/indicator-session.c b/src/indicator-session.c
index a815e40..0b8d77e 100644
--- a/src/indicator-session.c
+++ b/src/indicator-session.c
@@ -55,6 +55,7 @@ struct _IndicatorSession {
IndicatorServiceManager * service;
GtkImage * status_image;
DbusmenuGtkMenu * menu;
+ DBusGProxy * service_proxy;
};
GType indicator_session_get_type (void);
@@ -109,6 +110,12 @@ indicator_session_init (IndicatorSession *self)
dbusmenu_client_add_type_handler(client, MENU_SWITCH_TYPE, build_menu_switch);
dbusmenu_client_add_type_handler(client, USER_ITEM_TYPE, new_user_item);
+ DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
+ self->service_proxy = dbus_g_proxy_new_for_name(session_bus,
+ INDICATOR_SESSION_DBUS_NAME,
+ INDICATOR_SESSION_SERVICE_DBUS_OBJECT,
+ INDICATOR_SESSION_SERVICE_DBUS_IFACE);
+
return;
}
@@ -122,6 +129,11 @@ indicator_session_dispose (GObject *object)
self->service = NULL;
}
+ if (self->service_proxy != NULL) {
+ g_object_unref(self->service_proxy);
+ self->service_proxy = NULL;
+ }
+
G_OBJECT_CLASS (indicator_session_parent_class)->dispose (object);
return;
}