diff options
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | ChangeLog | 36 | ||||
-rwxr-xr-x | configure | 22 | ||||
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | debian/changelog | 9 | ||||
-rw-r--r-- | docs/libdbusmenu-glib/reference/html/ch01.html | 2 | ||||
-rw-r--r-- | docs/libdbusmenu-glib/reference/version.xml | 2 | ||||
-rw-r--r-- | docs/libdbusmenu-gtk/reference/html/ch01.html | 2 | ||||
-rw-r--r-- | docs/libdbusmenu-gtk/reference/version.xml | 2 | ||||
-rw-r--r-- | libdbusmenu-glib/client.c | 12 | ||||
-rw-r--r-- | libdbusmenu-gtk/client.c | 19 | ||||
-rw-r--r-- | libdbusmenu-gtk/parser.c | 51 |
12 files changed, 87 insertions, 77 deletions
@@ -5,6 +5,7 @@ Ara Pulido Aurelien Gateau Aurélien Gâteau + Charles Kerr Chris Coulson Cody Russell David Barth @@ -1,5 +1,41 @@ # Generated by Makefile. Do not edit. +2012-03-21 Ted Gould <ted@gould.cx> + + 0.5.95 + +2012-03-21 Charles Kerr <charles.kerr@canonical.com> + + merge lp:~charlesk/dbusmenu/lp-953509 to fix a crash in dbusmenu-gtk's handling of menu icon theme changes + +2012-03-21 Charles Kerr <charles.kerr@canonical.com> + + Don't listen for "changed" events from the screen's default GtkIconTheme. Fixes lp bug #953509 + + The crash in #953509 was being caused by the last two lines of theme_changed_cb() (a) leaving a dangling handler id in priv.theme_changed_sig, and (b) not remembering the handler id of its own signal connection. However after testing I don't see any reason to keep any of the theme handling code at all. + + "But wait," you say. "How will our menu icons follow the theme changes?" It works in practice anyway because we always listen for property changes to our reference GtkImage, **and** we listen for property changes to its GtkImageMenuItem parent so that if the GtkImageMenuItem changes GtkImages we can stop listening to the old one and start listening to the new one. + +2012-03-20 Charles Kerr <charles.kerr@canonical.com> + + merge lp:~ted/dbusmenu/regex_merge to fix a warning that comes up a lot with unity-panel-service about not having a label. + +2012-03-20 Ted Gould <ted@gould.cx> + + Fix string leak + +2012-03-20 Ted Gould <ted@gould.cx> + + Handle the case of the label being NULL which can happen on custom items + +2012-03-20 Ted Gould <ted@gould.cx> + + Don't ask for a reply if no one cares + +2012-03-16 Ryan Lortie <desrt@desrt.ca> + + glib client: don't request a reply on send_event() if nobody is listening for it + 2012-03-09 Ted Gould <ted@gould.cx> 0.5.94 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for libdbusmenu 0.5.94. +# Generated by GNU Autoconf 2.68 for libdbusmenu 0.5.95. # # Report bugs to <ted@canonical.com>. # @@ -572,8 +572,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libdbusmenu' PACKAGE_TARNAME='libdbusmenu' -PACKAGE_VERSION='0.5.94' -PACKAGE_STRING='libdbusmenu 0.5.94' +PACKAGE_VERSION='0.5.95' +PACKAGE_STRING='libdbusmenu 0.5.95' PACKAGE_BUGREPORT='ted@canonical.com' PACKAGE_URL='' @@ -1437,7 +1437,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 libdbusmenu 0.5.94 to adapt to many kinds of systems. +\`configure' configures libdbusmenu 0.5.95 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1507,7 +1507,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libdbusmenu 0.5.94:";; + short | recursive ) echo "Configuration of libdbusmenu 0.5.95:";; esac cat <<\_ACEOF @@ -1656,7 +1656,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libdbusmenu configure 0.5.94 +libdbusmenu configure 0.5.95 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2027,7 +2027,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 libdbusmenu $as_me 0.5.94, which was +It was created by libdbusmenu $as_me 0.5.95, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2848,7 +2848,7 @@ fi # Define the identity of the package. PACKAGE=libdbusmenu - VERSION=0.5.94 + VERSION=0.5.95 # Some tools Automake needs. @@ -14423,7 +14423,7 @@ fi ########################### LIBDBUSMENU_CURRENT=4 -LIBDBUSMENU_REVISION=11 +LIBDBUSMENU_REVISION=12 LIBDBUSMENU_AGE=0 @@ -15777,7 +15777,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 libdbusmenu $as_me 0.5.94, which was +This file was extended by libdbusmenu $as_me 0.5.95, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15843,7 +15843,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="\\ -libdbusmenu config.status 0.5.94 +libdbusmenu config.status 0.5.95 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index ef691c6..42c5b3d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ -AC_INIT(libdbusmenu, 0.5.94, ted@canonical.com) +AC_INIT(libdbusmenu, 0.5.95, ted@canonical.com) AC_COPYRIGHT([Copyright 2009,2010 Canonical]) AC_PREREQ(2.62) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libdbusmenu, 0.5.94, [-Wno-portability]) +AM_INIT_AUTOMAKE(libdbusmenu, 0.5.95, [-Wno-portability]) AM_MAINTAINER_MODE @@ -165,7 +165,7 @@ AC_PATH_PROG([XSLT_PROC], [xsltproc]) ########################### LIBDBUSMENU_CURRENT=4 -LIBDBUSMENU_REVISION=11 +LIBDBUSMENU_REVISION=12 LIBDBUSMENU_AGE=0 AC_SUBST(LIBDBUSMENU_CURRENT) diff --git a/debian/changelog b/debian/changelog index 3ddfe3b..a10f755 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +libdbusmenu (0.5.95-0ubuntu1~ppa1) precise; urgency=low + + * New upstream release. + * Fix theme change bug (LP: #953509) + * Don't request event responses if no one is listening + * Fix a warning on custom menu items without labels + + -- Ted Gould <ted@ubuntu.com> Wed, 21 Mar 2012 14:33:32 -0500 + libdbusmenu (0.5.94-0ubuntu1) precise; urgency=low * New upstream release. diff --git a/docs/libdbusmenu-glib/reference/html/ch01.html b/docs/libdbusmenu-glib/reference/html/ch01.html index e843ba4..da25d71 100644 --- a/docs/libdbusmenu-glib/reference/html/ch01.html +++ b/docs/libdbusmenu-glib/reference/html/ch01.html @@ -21,7 +21,7 @@ </tr></table> <div class="chapter"> <div class="titlepage"><div><div><h2 class="title"> -<a name="idp3882768"></a>API</h2></div></div></div> +<a name="idp5150560"></a>API</h2></div></div></div> <div class="toc"><dl> <dt> <span class="refentrytitle"><a href="libdbusmenu-glib-DbusmenuServer.html">DbusmenuServer</a></span><span class="refpurpose"> — The server signals changed and diff --git a/docs/libdbusmenu-glib/reference/version.xml b/docs/libdbusmenu-glib/reference/version.xml index 622db42..cd98256 100644 --- a/docs/libdbusmenu-glib/reference/version.xml +++ b/docs/libdbusmenu-glib/reference/version.xml @@ -1 +1 @@ -0.5.94 +0.5.95 diff --git a/docs/libdbusmenu-gtk/reference/html/ch01.html b/docs/libdbusmenu-gtk/reference/html/ch01.html index 3f9b1de..e7fedd0 100644 --- a/docs/libdbusmenu-gtk/reference/html/ch01.html +++ b/docs/libdbusmenu-gtk/reference/html/ch01.html @@ -21,7 +21,7 @@ </tr></table> <div class="chapter"> <div class="titlepage"><div><div><h2 class="title"> -<a name="idp3527472"></a>API</h2></div></div></div> +<a name="idp2311712"></a>API</h2></div></div></div> <div class="toc"><dl> <dt> <span class="refentrytitle"><a href="libdbusmenu-gtk-DbusmenuGtkMenu.html">DbusmenuGtkMenu</a></span><span class="refpurpose"> — A GTK Menu Object that syncronizes over DBus</span> diff --git a/docs/libdbusmenu-gtk/reference/version.xml b/docs/libdbusmenu-gtk/reference/version.xml index 622db42..cd98256 100644 --- a/docs/libdbusmenu-gtk/reference/version.xml +++ b/docs/libdbusmenu-gtk/reference/version.xml @@ -1 +1 @@ -0.5.94 +0.5.95 diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 01f063d..7d96db3 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -1540,6 +1540,18 @@ dbusmenu_client_send_event (DbusmenuClient * client, gint id, const gchar * name variant = g_variant_new_int32(0); } + /* Don't bother with the reply handling if nobody is watching... */ + if (!g_signal_has_handler_pending (client, signals[EVENT_RESULT], 0, TRUE)) { + g_dbus_proxy_call(priv->menuproxy, + "Event", + g_variant_new("(isvu)", id, name, variant, timestamp), + G_DBUS_CALL_FLAGS_NONE, + 1000, /* timeout */ + NULL, /* cancellable */ + NULL, NULL); + return; + } + event_data_t * edata = g_new0(event_data_t, 1); edata->client = client; g_object_ref(client); diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 9cb1144..f507a56 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -738,24 +738,27 @@ process_a11y_desc (DbusmenuMenuitem * mi, GtkMenuItem * gmi, GVariant * variant, if (variant != NULL) { const gchar * setname = NULL; - setname = g_variant_dup_string(variant, NULL); + setname = g_variant_get_string(variant, NULL); atk_object_set_name(aobj, setname); } else { /* The atk docs advise to set the name of the atk object to an empty * string, but GTK doesn't yet do the same, and setting the name to NULL * causes tests to fail. */ - gchar * setname = NULL; const gchar * label = NULL; - /* We don't want the underscore for mnewmonics */ label = dbusmenu_menuitem_property_get(mi, DBUSMENU_MENUITEM_PROP_LABEL); - GRegex * regex = g_regex_new ("_", 0, 0, NULL); - setname = g_regex_replace_literal (regex, label, -1, 0, "", 0, NULL); - g_regex_unref(regex); + if (label != NULL) { + gchar * setname = NULL; - atk_object_set_name(aobj, setname); - g_free(setname); + /* We don't want the underscore for mnewmonics */ + GRegex * regex = g_regex_new ("_", 0, 0, NULL); + setname = g_regex_replace_literal (regex, label, -1, 0, "", 0, NULL); + g_regex_unref(regex); + + atk_object_set_name(aobj, setname); + g_free(setname); + } } return; diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index da1c8fa..b98f34b 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -45,7 +45,6 @@ typedef struct _ParserData GtkWidget *image; AtkObject *accessible; - guint theme_changed_sig; } ParserData; typedef struct _RecurseContext @@ -86,8 +85,6 @@ static void item_inserted_cb (GtkContainer * menu, static void item_removed_cb (GtkContainer * menu, GtkWidget * widget, gpointer data); -static void theme_changed_cb (GtkIconTheme * theme, - gpointer data); static void item_activated (DbusmenuMenuitem * item, guint timestamp, gpointer user_data); @@ -216,29 +213,11 @@ parse_data_free (gpointer data) g_object_remove_weak_pointer(G_OBJECT(pdata->accessible), (gpointer*)&pdata->accessible); } - if (pdata != NULL && pdata->theme_changed_sig != 0) { - g_signal_handler_disconnect(gtk_icon_theme_get_default(), pdata->theme_changed_sig); - pdata->theme_changed_sig = 0; - } - g_free(pdata); return; } -static void -widget_freed (gpointer data, GObject * obj) -{ - ParserData * pdata = (ParserData *)data; - - if (pdata->theme_changed_sig != 0) { - g_signal_handler_disconnect(gtk_icon_theme_get_default(), pdata->theme_changed_sig); - pdata->theme_changed_sig = 0; - } - - return; -} - /* Called when the dbusmenu item that we're keeping around is finalized */ static void @@ -247,12 +226,7 @@ dbusmenu_item_freed (gpointer data, GObject * obj) ParserData *pdata = (ParserData *)g_object_get_data(G_OBJECT(obj), PARSER_DATA); if (pdata != NULL && pdata->widget != NULL) { - if (pdata->theme_changed_sig != 0) { - g_signal_handler_disconnect(gtk_icon_theme_get_default(), pdata->theme_changed_sig); - pdata->theme_changed_sig = 0; - } g_object_steal_data(G_OBJECT(pdata->widget), CACHED_MENUITEM); - g_object_weak_unref(G_OBJECT(pdata->widget), widget_freed, pdata); } } @@ -294,7 +268,6 @@ new_menuitem (GtkWidget * widget) g_object_set_data_full(G_OBJECT(item), PARSER_DATA, pdata, parse_data_free); g_object_weak_ref(G_OBJECT(item), dbusmenu_item_freed, NULL); - g_object_weak_ref(G_OBJECT(widget), widget_freed, pdata); pdata->widget = widget; g_object_add_weak_pointer(G_OBJECT (widget), (gpointer*)&pdata->widget); @@ -757,10 +730,6 @@ update_icon (DbusmenuMenuitem *menuitem, ParserData * pdata, GtkImageMenuItem * we can't get it easily, and those mean it's not changed just the icon underneith, so we can ignore these larger impacts */ if (image != GTK_IMAGE(pdata->image) && gmenuitem != NULL) { - if (pdata->theme_changed_sig != 0) { - g_signal_handler_disconnect(gtk_icon_theme_get_default(), pdata->theme_changed_sig); - pdata->theme_changed_sig = 0; - } if (pdata->image != NULL) { g_signal_handlers_disconnect_by_func(pdata->image, G_CALLBACK(image_notify_cb), menuitem); @@ -770,8 +739,6 @@ update_icon (DbusmenuMenuitem *menuitem, ParserData * pdata, GtkImageMenuItem * pdata->image = GTK_WIDGET(image); if (pdata->image != NULL) { - pdata->theme_changed_sig = g_signal_connect(G_OBJECT(gtk_icon_theme_get_default()), - "changed", G_CALLBACK(theme_changed_cb), gmenuitem); g_signal_connect (G_OBJECT (pdata->image), "notify", G_CALLBACK (image_notify_cb), @@ -1287,24 +1254,6 @@ item_removed_cb (GtkContainer *menu, GtkWidget *widget, gpointer data) return; } -static void -theme_changed_cb (GtkIconTheme *theme, gpointer data) -{ - GtkWidget *image; - - image = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (data)); - - gpointer pmi = g_object_get_data(G_OBJECT(data), CACHED_MENUITEM); - if (pmi != NULL) { - ParserData *pdata = (ParserData *)g_object_get_data(G_OBJECT(pmi), PARSER_DATA); - update_icon(DBUSMENU_MENUITEM(pmi), pdata, NULL, GTK_IMAGE(image)); - } - - /* Switch signal to new theme */ - g_signal_handlers_disconnect_by_func(theme, G_CALLBACK(theme_changed_cb), data); - g_signal_connect(gtk_icon_theme_get_default(), "changed", G_CALLBACK(theme_changed_cb), data); -} - static gboolean should_show_image (GtkImage *image) { |