diff options
author | Ted Gould <ted@canonical.com> | 2009-10-29 17:21:39 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-10-29 17:21:39 -0500 |
commit | 58194766a1163b1e1df94ef391403a2a827e3e95 (patch) | |
tree | 3a24103c59fea9d68c842245a81778a27fa6a607 /libindicator/indicator-service.c | |
parent | fbba41584475d598deab170e12ba81b16f3601aa (diff) | |
download | libayatana-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.
Diffstat (limited to 'libindicator/indicator-service.c')
-rw-r--r-- | libindicator/indicator-service.c | 10 |
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; } |