aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-02-06 10:56:44 -0800
committerTed Gould <ted@gould.cx>2010-02-06 10:56:44 -0800
commit130e93c1195cad4a74e84602e71b08786cfbd5db (patch)
tree80a0e33c6af2cbfa0e30092a7701f4e03d303835 /src
parent87a7acd9fc0069cb2f4fee96e42ee6651b35629f (diff)
downloadlibayatana-appindicator-130e93c1195cad4a74e84602e71b08786cfbd5db.tar.gz
libayatana-appindicator-130e93c1195cad4a74e84602e71b08786cfbd5db.tar.bz2
libayatana-appindicator-130e93c1195cad4a74e84602e71b08786cfbd5db.zip
Changing the proxy to only build if we need it, and not destroy itself on killing the process. There's really no reason for that.
Diffstat (limited to 'src')
-rw-r--r--src/indicator-application.c88
1 files changed, 45 insertions, 43 deletions
diff --git a/src/indicator-application.c b/src/indicator-application.c
index c7789f1..f6fe314 100644
--- a/src/indicator-application.c
+++ b/src/indicator-application.c
@@ -241,50 +241,52 @@ connected (IndicatorApplication * application)
}
}
+ if (priv->service_proxy) {
/* Build the service proxy */
- priv->service_proxy = dbus_g_proxy_new_for_name_owner(priv->bus,
- INDICATOR_APPLICATION_DBUS_ADDR,
- INDICATOR_APPLICATION_DBUS_OBJ,
- INDICATOR_APPLICATION_DBUS_IFACE,
- &error);
-
- /* Set up proxy signals */
- g_debug("Setup proxy signals");
- dbus_g_proxy_add_signal(priv->service_proxy,
- "ApplicationAdded",
- G_TYPE_STRING,
- G_TYPE_INT,
- G_TYPE_STRING,
- G_TYPE_STRING,
- G_TYPE_STRING,
- G_TYPE_INVALID);
- dbus_g_proxy_add_signal(priv->service_proxy,
- "ApplicationRemoved",
- G_TYPE_INT,
- G_TYPE_INVALID);
- dbus_g_proxy_add_signal(priv->service_proxy,
- "ApplicationIconChanged",
- G_TYPE_INT,
- G_TYPE_STRING,
- G_TYPE_INVALID);
-
- /* Connect to them */
- g_debug("Connect to them.");
- dbus_g_proxy_connect_signal(priv->service_proxy,
- "ApplicationAdded",
- G_CALLBACK(application_added),
- application,
- NULL /* Disconnection Signal */);
- dbus_g_proxy_connect_signal(priv->service_proxy,
- "ApplicationRemoved",
- G_CALLBACK(application_removed),
- application,
- NULL /* Disconnection Signal */);
- dbus_g_proxy_connect_signal(priv->service_proxy,
- "ApplicationIconChanged",
- G_CALLBACK(application_icon_changed),
- application,
- NULL /* Disconnection Signal */);
+ priv->service_proxy = dbus_g_proxy_new_for_name(priv->bus,
+ INDICATOR_APPLICATION_DBUS_ADDR,
+ INDICATOR_APPLICATION_DBUS_OBJ,
+ INDICATOR_APPLICATION_DBUS_IFACE,
+ &error);
+
+ /* Set up proxy signals */
+ g_debug("Setup proxy signals");
+ dbus_g_proxy_add_signal(priv->service_proxy,
+ "ApplicationAdded",
+ G_TYPE_STRING,
+ G_TYPE_INT,
+ G_TYPE_STRING,
+ G_TYPE_STRING,
+ G_TYPE_STRING,
+ G_TYPE_INVALID);
+ dbus_g_proxy_add_signal(priv->service_proxy,
+ "ApplicationRemoved",
+ G_TYPE_INT,
+ G_TYPE_INVALID);
+ dbus_g_proxy_add_signal(priv->service_proxy,
+ "ApplicationIconChanged",
+ G_TYPE_INT,
+ G_TYPE_STRING,
+ G_TYPE_INVALID);
+
+ /* Connect to them */
+ g_debug("Connect to them.");
+ dbus_g_proxy_connect_signal(priv->service_proxy,
+ "ApplicationAdded",
+ G_CALLBACK(application_added),
+ application,
+ NULL /* Disconnection Signal */);
+ dbus_g_proxy_connect_signal(priv->service_proxy,
+ "ApplicationRemoved",
+ G_CALLBACK(application_removed),
+ application,
+ NULL /* Disconnection Signal */);
+ dbus_g_proxy_connect_signal(priv->service_proxy,
+ "ApplicationIconChanged",
+ G_CALLBACK(application_icon_changed),
+ application,
+ NULL /* Disconnection Signal */);
+ }
/* Query it for existing applications */
g_debug("Request current apps");