aboutsummaryrefslogtreecommitdiff
path: root/libindicator
diff options
context:
space:
mode:
authorEvgeni Golov <evgeni@debian.org>2010-07-25 12:09:27 +0200
committerEvgeni Golov <evgeni@debian.org>2010-07-25 12:09:27 +0200
commitff0659790100524b2bbdf5eac35374e88efd2d52 (patch)
tree8dff5da300477337939326355b971be5083e317f /libindicator
parent8b7fa3f649123d88bc1a036795fd9a85d6565ab4 (diff)
parent21ba0389821c80f113c9f3512ac36d62e3097505 (diff)
downloadlibayatana-indicator-ff0659790100524b2bbdf5eac35374e88efd2d52.tar.gz
libayatana-indicator-ff0659790100524b2bbdf5eac35374e88efd2d52.tar.bz2
libayatana-indicator-ff0659790100524b2bbdf5eac35374e88efd2d52.zip
* Merging new upstream release from Ubuntu.0.3.10-1
* New upstream release. * Fixing unwatching crash (LP: #603489) * Adding configurable timeout for slow test systems
Diffstat (limited to 'libindicator')
-rw-r--r--libindicator/Makefile.in5
-rw-r--r--libindicator/indicator-service.c17
2 files changed, 16 insertions, 6 deletions
diff --git a/libindicator/Makefile.in b/libindicator/Makefile.in
index 9d5a624..ebe7648 100644
--- a/libindicator/Makefile.in
+++ b/libindicator/Makefile.in
@@ -57,10 +57,7 @@ DIST_COMMON = $(libindicatorinclude_HEADERS) $(srcdir)/Makefile.am \
$(top_srcdir)/Makefile.am.marshal
subdir = libindicator
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c
index 55fb650..e9005db 100644
--- a/libindicator/indicator-service.c
+++ b/libindicator/indicator-service.c
@@ -55,6 +55,7 @@ struct _IndicatorServicePrivate {
DBusGProxy * dbus_proxy;
DBusGConnection * bus;
guint timeout;
+ guint timeout_length;
GHashTable * watchers;
guint this_service_version;
};
@@ -164,6 +165,16 @@ indicator_service_init (IndicatorService *self)
priv->watchers = NULL;
priv->bus = NULL;
priv->this_service_version = 0;
+ priv->timeout_length = 500;
+
+ const gchar * timeoutenv = g_getenv("INDICATOR_SERVICE_SHUTDOWN_TIMEOUT");
+ if (timeoutenv != NULL) {
+ gdouble newtimeout = g_strtod(timeoutenv, NULL);
+ if (newtimeout >= 1.0f) {
+ priv->timeout_length = newtimeout;
+ g_debug("Setting shutdown timeout to: %u", priv->timeout_length);
+ }
+ }
/* NOTE: We're using g_object_unref here because that's what needs to
happen, but you really should call watchers_remove first as well
@@ -373,7 +384,9 @@ try_and_get_name_cb (DBusGProxy * proxy, guint status, GError * error, gpointer
}
IndicatorServicePrivate * priv = INDICATOR_SERVICE_GET_PRIVATE(service);
- priv->timeout = g_timeout_add_seconds(1, timeout_no_watchers, service);
+ /* Allow some extra time at start up as things can be in high
+ contention then. */
+ priv->timeout = g_timeout_add(priv->timeout_length * 2, timeout_no_watchers, service);
return;
}
@@ -515,7 +528,7 @@ unwatch_core (IndicatorService * service, const gchar * name)
priv->timeout = 0;
}
/* If we don't get a new watcher quickly, we'll shutdown. */
- priv->timeout = g_timeout_add(500, timeout_no_watchers, service);
+ priv->timeout = g_timeout_add(priv->timeout_length, timeout_no_watchers, service);
}
return;