diff options
-rw-r--r-- | ChangeLog | 20 | ||||
-rwxr-xr-x | configure | 20 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | debian/changelog | 7 | ||||
-rw-r--r-- | libindicator/Makefile.am | 4 | ||||
-rw-r--r-- | libindicator/Makefile.in | 4 | ||||
-rw-r--r-- | libindicator/indicator-service-manager.c | 43 |
7 files changed, 77 insertions, 25 deletions
@@ -1,5 +1,25 @@ # Generated by Makefile. Do not edit. +2011-01-14 Ted Gould <ted@gould.cx> + + 0.3.17 + +2011-01-13 Ted Gould <ted@gould.cx> + + Use dbus name watches instead of g-owner-change signal for watching for restarts. + +2011-01-13 Michael Terry <mike@mterry.name> + + use actual DBus NameOwnerChanged interface rather than GDBus's higher level signal because that one only works for well-known names + +2011-01-13 Michael Terry <mike@mterry.name> + + fix basename issue when make is given full path + +2011-01-13 Ted Gould <ted@gould.cx> + + 0.3.16 + 2011-01-10 Ted Gould <ted@gould.cx> Adding a signal for the menu being closed. @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67 for libindicator 0.3.16. +# Generated by GNU Autoconf 2.67 for libindicator 0.3.17. # # Report bugs to <ted@canonical.com>. # @@ -701,8 +701,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libindicator' PACKAGE_TARNAME='libindicator' -PACKAGE_VERSION='0.3.16' -PACKAGE_STRING='libindicator 0.3.16' +PACKAGE_VERSION='0.3.17' +PACKAGE_STRING='libindicator 0.3.17' PACKAGE_BUGREPORT='ted@canonical.com' PACKAGE_URL='' @@ -1443,7 +1443,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libindicator 0.3.16 to adapt to many kinds of systems. +\`configure' configures libindicator 0.3.17 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1513,7 +1513,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libindicator 0.3.16:";; + short | recursive ) echo "Configuration of libindicator 0.3.17:";; esac cat <<\_ACEOF @@ -1628,7 +1628,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libindicator configure 0.3.16 +libindicator configure 0.3.17 generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1906,7 +1906,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libindicator $as_me 0.3.16, which was +It was created by libindicator $as_me 0.3.17, which was generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ @@ -2726,7 +2726,7 @@ fi # Define the identity of the package. PACKAGE=libindicator - VERSION=0.3.16 + VERSION=0.3.17 cat >>confdefs.h <<_ACEOF @@ -12361,7 +12361,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libindicator $as_me 0.3.16, which was +This file was extended by libindicator $as_me 0.3.17, which was generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -12427,7 +12427,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libindicator config.status 0.3.16 +libindicator config.status 0.3.17 configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index d78af70..6396bd3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ -AC_INIT(libindicator, 0.3.16, ted@canonical.com) +AC_INIT(libindicator, 0.3.17, ted@canonical.com) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libindicator, 0.3.16) +AM_INIT_AUTOMAKE(libindicator, 0.3.17) AM_MAINTAINER_MODE m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES]) diff --git a/debian/changelog b/debian/changelog index f286daf..461d173 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +libindicator (0.3.17-0ubuntu1~ppa1) UNRELEASED; urgency=low + + * New upstream release. + * Fixing catching services dropping off + + -- Ted Gould <ted@ubuntu.com> Fri, 14 Jan 2011 11:03:58 -0600 + libindicator (0.3.16-0ubuntu1) natty; urgency=low * New upstream release. diff --git a/libindicator/Makefile.am b/libindicator/Makefile.am index 5c70345..47a902a 100644 --- a/libindicator/Makefile.am +++ b/libindicator/Makefile.am @@ -104,11 +104,11 @@ DBUS_SPECS = \ gen-%.xml.h: %.xml @echo "Building $@ from $<" - @echo "extern const char * _$(subst -,_,$(subst .,_,$(basename $<)));" > $@ + @echo "extern const char * _$(subst -,_,$(subst .,_,$(basename $(notdir $<))));" > $@ gen-%.xml.c: %.xml @echo "Building $@ from $<" - @echo "const char * _$(subst -,_,$(subst .,_,$(basename $<))) = " > $@ + echo "const char * _$(subst -,_,$(subst .,_,$(basename $(notdir $<)))) = " > $@ @sed -e "s:\":\\\\\":g" -e s:^:\": -e s:\$$:\\\\n\": $< >> $@ @echo ";" >> $@ diff --git a/libindicator/Makefile.in b/libindicator/Makefile.in index cfbeb09..78b19ad 100644 --- a/libindicator/Makefile.in +++ b/libindicator/Makefile.in @@ -932,11 +932,11 @@ s-enum-types-c: $(indicator_headers) gen-%.xml.h: %.xml @echo "Building $@ from $<" - @echo "extern const char * _$(subst -,_,$(subst .,_,$(basename $<)));" > $@ + @echo "extern const char * _$(subst -,_,$(subst .,_,$(basename $(notdir $<))));" > $@ gen-%.xml.c: %.xml @echo "Building $@ from $<" - @echo "const char * _$(subst -,_,$(subst .,_,$(basename $<))) = " > $@ + echo "const char * _$(subst -,_,$(subst .,_,$(basename $(notdir $<)))) = " > $@ @sed -e "s:\":\\\\\":g" -e s:^:\": -e s:\$$:\\\\n\": $< >> $@ @echo ";" >> $@ diff --git a/libindicator/indicator-service-manager.c b/libindicator/indicator-service-manager.c index 34b6baa..f3a29d0 100644 --- a/libindicator/indicator-service-manager.c +++ b/libindicator/indicator-service-manager.c @@ -46,6 +46,7 @@ struct _IndicatorServiceManagerPrivate { gchar * name; GDBusProxy * service_proxy; GCancellable * service_proxy_cancel; + guint name_watcher; gboolean connected; guint this_service_version; guint restart_count; @@ -102,7 +103,7 @@ static void start_service (IndicatorServiceManager * service); static void start_service_again (IndicatorServiceManager * manager); static void unwatch (GDBusProxy * proxy); static void service_proxy_cb (GObject * object, GAsyncResult * res, gpointer user_data); -static void service_proxy_name_change (GObject * object, GParamSpec * pspec, gpointer user_data); +static void service_proxy_name_changed (GDBusConnection * connection, const gchar * sender_name, const gchar * object_path, const gchar * interface_name, const gchar * signal_name, GVariant * parameters, gpointer user_data); G_DEFINE_TYPE (IndicatorServiceManager, indicator_service_manager, G_TYPE_OBJECT); @@ -186,6 +187,7 @@ indicator_service_manager_init (IndicatorServiceManager *self) priv->name = NULL; priv->service_proxy = NULL; priv->service_proxy_cancel = NULL; + priv->name_watcher = 0; priv->connected = FALSE; priv->this_service_version = 0; priv->restart_count = 0; @@ -218,6 +220,12 @@ indicator_service_manager_dispose (GObject *object) g_signal_emit(object, signals[CONNECTION_CHANGE], 0, FALSE, TRUE); } + if (priv->name_watcher != 0) { + g_dbus_connection_signal_unsubscribe(g_dbus_proxy_get_connection(priv->service_proxy), + priv->name_watcher); + priv->name_watcher = 0; + } + /* If we're still getting the proxy, stop looking so we can then clean up some more. */ if (priv->service_proxy_cancel != NULL) { @@ -442,7 +450,7 @@ start_service (IndicatorServiceManager * service) return; } -/* Callback from trying to create the proxy for the serivce, this +/* Callback from trying to create the proxy for the service, this could include starting the service. Sometime it'll fail and we'll try to start that dang service again! */ static void @@ -486,7 +494,17 @@ service_proxy_cb (GObject * object, GAsyncResult * res, gpointer user_data) priv->service_proxy = proxy; /* Signal for drop */ - g_signal_connect(G_OBJECT(priv->service_proxy), "notify::g-name-owner", G_CALLBACK(service_proxy_name_change), user_data); + priv->name_watcher = g_dbus_connection_signal_subscribe( + g_dbus_proxy_get_connection(proxy), + "org.freedesktop.DBus", + "org.freedesktop.DBus", + "NameOwnerChanged", + "/org/freedesktop/DBus", + g_dbus_proxy_get_name(proxy), + G_DBUS_SIGNAL_FLAGS_NONE, + service_proxy_name_changed, + user_data, + NULL); /* Build cancelable if we need it */ if (priv->watch_cancel == NULL) { @@ -510,12 +528,18 @@ service_proxy_cb (GObject * object, GAsyncResult * res, gpointer user_data) usually means the service died. We're dropping the proxy and recreating it so that it'll restart the service. */ static void -service_proxy_name_change (GObject * object, GParamSpec * pspec, gpointer user_data) +service_proxy_name_changed (GDBusConnection * connection, const gchar * sender_name, + const gchar * object_path, const gchar * interface_name, + const gchar * signal_name, GVariant * parameters, + gpointer user_data) + { IndicatorServiceManagerPrivate * priv = INDICATOR_SERVICE_MANAGER_GET_PRIVATE(user_data); - gchar * name = g_dbus_proxy_get_name_owner(priv->service_proxy); - if (name == NULL) { + const gchar * new_name; + g_variant_get(parameters, "(&s&s&s)", NULL, NULL, &new_name); + + if (new_name == NULL || new_name[0] == 0) { if (priv->connected) { priv->connected = FALSE; g_signal_emit(G_OBJECT(user_data), signals[CONNECTION_CHANGE], 0, FALSE, TRUE); @@ -523,9 +547,10 @@ service_proxy_name_change (GObject * object, GParamSpec * pspec, gpointer user_d start_service_again(INDICATOR_SERVICE_MANAGER(user_data)); } else { - /* This case is an oddity, and really can only be a weird race - condition. So we're going to ignore it for now. */ - g_free(name); + if (!priv->connected) { + priv->connected = TRUE; + g_signal_emit(G_OBJECT(user_data), signals[CONNECTION_CHANGE], 0, TRUE, TRUE); + } } return; |