aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-01-15 22:28:13 -0600
committerTed Gould <ted@gould.cx>2010-01-15 22:28:13 -0600
commit079c2b517deba95385ac47eea1fd6560aef3aacb (patch)
treee43588ade852c78ab261f803418e20ea996a2d87
parent62d8c1c86b21ab250342900324565f1b95ac2da8 (diff)
downloadlibayatana-indicator-079c2b517deba95385ac47eea1fd6560aef3aacb.tar.gz
libayatana-indicator-079c2b517deba95385ac47eea1fd6560aef3aacb.tar.bz2
libayatana-indicator-079c2b517deba95385ac47eea1fd6560aef3aacb.zip
It's a fundamental mistake to believe that we can protect people using
this interface from the disconnection. We have no information to say that the new service starting will come up in the same state as the one before it. We need the individual implementers to verify that. Now we need to fix that. This commit does so.
-rw-r--r--libindicator/indicator-service-manager.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libindicator/indicator-service-manager.c b/libindicator/indicator-service-manager.c
index 9d56a9f..891f49e 100644
--- a/libindicator/indicator-service-manager.c
+++ b/libindicator/indicator-service-manager.c
@@ -433,6 +433,11 @@ start_service (IndicatorServiceManager * service)
static void
service_proxy_destroyed (DBusGProxy * proxy, gpointer user_data)
{
+ IndicatorServiceManagerPrivate * priv = INDICATOR_SERVICE_MANAGER_GET_PRIVATE(user_data);
+ if (priv->connected) {
+ priv->connected = FALSE;
+ g_signal_emit(G_OBJECT(user_data), signals[CONNECTION_CHANGE], 0, FALSE, TRUE);
+ }
return start_service_again(INDICATOR_SERVICE_MANAGER(user_data));
}
@@ -459,8 +464,6 @@ start_service_again (IndicatorServiceManager * manager)
/* Allow the restarting to be disabled */
if (g_getenv(TIMEOUT_ENV_NAME)) {
- priv->connected = FALSE;
- g_signal_emit(manager, signals[CONNECTION_CHANGE], 0, FALSE, TRUE);
return;
}
@@ -469,10 +472,6 @@ start_service_again (IndicatorServiceManager * manager)
g_idle_add(start_service_again_cb, manager);
} else {
/* Not our first time 'round the block. Let's slow this down. */
- if (priv->connected) {
- priv->connected = FALSE;
- g_signal_emit(manager, signals[CONNECTION_CHANGE], 0, FALSE, TRUE);
- }
if (priv->restart_count > 16)
priv->restart_count = 16; /* Not more than 1024x */
g_timeout_add((1 << priv->restart_count) * TIMEOUT_MULTIPLIER, start_service_again_cb, manager);