aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-10-29 17:21:39 -0500
committerTed Gould <ted@canonical.com>2009-10-29 17:21:39 -0500
commit58194766a1163b1e1df94ef391403a2a827e3e95 (patch)
tree3a24103c59fea9d68c842245a81778a27fa6a607
parentfbba41584475d598deab170e12ba81b16f3601aa (diff)
downloadlibayatana-indicator-58194766a1163b1e1df94ef391403a2a827e3e95.tar.gz
libayatana-indicator-58194766a1163b1e1df94ef391403a2a827e3e95.tar.bz2
libayatana-indicator-58194766a1163b1e1df94ef391403a2a827e3e95.zip
Sending shutdown signal 500 ms after getting a name if we have no watchers.
-rw-r--r--libindicator/indicator-service.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c
index cf02bac..4cc99d2 100644
--- a/libindicator/indicator-service.c
+++ b/libindicator/indicator-service.c
@@ -238,6 +238,13 @@ get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspe
return;
}
+static gboolean
+timeout_no_watchers (gpointer data)
+{
+ g_signal_emit(G_OBJECT(data), signals[SHUTDOWN], 0, TRUE);
+ return FALSE;
+}
+
static void
try_and_get_name_cb (DBusGProxy * proxy, guint status, GError * error, gpointer data)
{
@@ -252,6 +259,9 @@ try_and_get_name_cb (DBusGProxy * proxy, guint status, GError * error, gpointer
return;
}
+ IndicatorServicePrivate * priv = INDICATOR_SERVICE_GET_PRIVATE(service);
+ priv->timeout = g_timeout_add(500, timeout_no_watchers, service);
+
return;
}