diff options
author | Ted Gould <ted@gould.cx> | 2011-07-14 13:33:11 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-07-14 13:33:11 -0500 |
commit | 6032a847e527d10641396268dfe4d0db176d3b56 (patch) | |
tree | 62d2efca4b4ce17c6dd57e38a6822f5d71bb2e87 /libindicator/indicator-service-manager.c | |
parent | c1034173faf54120c693c984123f343968621359 (diff) | |
parent | c6d763c2fa431fefd0869d381b15c25364e8972f (diff) | |
download | libayatana-indicator-6032a847e527d10641396268dfe4d0db176d3b56.tar.gz libayatana-indicator-6032a847e527d10641396268dfe4d0db176d3b56.tar.bz2 libayatana-indicator-6032a847e527d10641396268dfe4d0db176d3b56.zip |
Import upstream version 0.3.91
Diffstat (limited to 'libindicator/indicator-service-manager.c')
-rw-r--r-- | libindicator/indicator-service-manager.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/libindicator/indicator-service-manager.c b/libindicator/indicator-service-manager.c index f3a29d0..f58c148 100644 --- a/libindicator/indicator-service-manager.c +++ b/libindicator/indicator-service-manager.c @@ -536,8 +536,9 @@ service_proxy_name_changed (GDBusConnection * connection, const gchar * sender_n { IndicatorServiceManagerPrivate * priv = INDICATOR_SERVICE_MANAGER_GET_PRIVATE(user_data); - const gchar * new_name; - g_variant_get(parameters, "(&s&s&s)", NULL, NULL, &new_name); + const gchar * new_name = NULL; + const gchar * prev_name = NULL; + g_variant_get(parameters, "(&s&s&s)", NULL, &prev_name, &new_name); if (new_name == NULL || new_name[0] == 0) { if (priv->connected) { @@ -547,10 +548,27 @@ service_proxy_name_changed (GDBusConnection * connection, const gchar * sender_n start_service_again(INDICATOR_SERVICE_MANAGER(user_data)); } else { + /* If we weren't connected before, we are now. Let's tell the + world! */ if (!priv->connected) { priv->connected = TRUE; g_signal_emit(G_OBJECT(user_data), signals[CONNECTION_CHANGE], 0, TRUE, TRUE); } + + /* If the names are both valid, and they're not the same, it means that + we've actually changed. So we need to tell the new guy that we're + watching them */ + if (new_name != NULL && prev_name != NULL && new_name[0] != 0 && prev_name != 0 && g_strcmp0(prev_name, new_name) != 0) { + /* Send watch */ + g_dbus_proxy_call(priv->service_proxy, + "Watch", + NULL, /* params */ + G_DBUS_CALL_FLAGS_NONE, + -1, + priv->watch_cancel, + watch_cb, + user_data); + } } return; |