From 13ca9a89915c4a06806d5f46bf304e2952848bd2 Mon Sep 17 00:00:00 2001 From: Luke Yelavich Date: Fri, 17 Feb 2012 15:01:53 +1100 Subject: Do not set the accessible name to an empty string if the accessible_desc property = NULL. Yes this was recently changed so that dbusmenu conformed to Atk documentation, but the GTK menu item accessibility code does not yet conform to sed documentation. As a result, all dbusmenu menu items that do not have the accessible_desc property set end up getting an empty string for their accessible name. In the long term, GTK accessibility needs to be fixed. --- libdbusmenu-gtk/client.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 830356a..1883eea 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -741,10 +741,6 @@ process_a11y_desc (DbusmenuMenuitem * mi, GtkMenuItem * gmi, GVariant * variant, setname = g_variant_get_string(variant, NULL); } - if (setname == NULL) { - setname = ""; - } - atk_object_set_name(aobj, setname); return; } -- cgit v1.2.3 From 6d953d231b4d974d1c79e604e88b55c13499433d Mon Sep 17 00:00:00 2001 From: Luke Yelavich Date: Thu, 8 Mar 2012 16:15:06 +1100 Subject: Set the accessible name from the dbusmenu item label. THis is a work-around until GTK follows atk docs. --- libdbusmenu-gtk/client.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 1883eea..4c3f1c2 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -741,6 +741,14 @@ process_a11y_desc (DbusmenuMenuitem * mi, GtkMenuItem * gmi, GVariant * variant, setname = g_variant_get_string(variant, NULL); } + /* 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. + */ + if (setname == NULL) { + setname = dbusmenu_menuitem_property_get(mi, DBUSMENU_MENUITEM_PROP_LABEL); + } + atk_object_set_name(aobj, setname); return; } -- cgit v1.2.3 From 004ede5cfbcab69652857f0d25d7ddab5bfe0b23 Mon Sep 17 00:00:00 2001 From: Luke Yelavich Date: Fri, 9 Mar 2012 11:30:43 +1100 Subject: Remove the underscores used for mnewmonics, as orca speaks them, which is not what we want. --- libdbusmenu-gtk/client.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 4c3f1c2..95d6b8b 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -736,6 +736,7 @@ process_a11y_desc (DbusmenuMenuitem * mi, GtkMenuItem * gmi, GVariant * variant, } const gchar * setname = NULL; + const gchar * label = NULL; if (variant != NULL) { setname = g_variant_get_string(variant, NULL); @@ -746,7 +747,12 @@ process_a11y_desc (DbusmenuMenuitem * mi, GtkMenuItem * gmi, GVariant * variant, * causes tests to fail. */ if (setname == NULL) { - setname = dbusmenu_menuitem_property_get(mi, DBUSMENU_MENUITEM_PROP_LABEL); + /* 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); } atk_object_set_name(aobj, setname); -- cgit v1.2.3 From 4bd8e21dee661f26f8e1b4522cd3f955b5080e29 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Mar 2012 09:10:02 -0600 Subject: Missing a couple of cases of removing the signal handler and clearing the stored value --- libdbusmenu-gtk/parser.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index 70ffcea..da1c8fa 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -229,7 +229,12 @@ parse_data_free (gpointer data) static void widget_freed (gpointer data, GObject * obj) { - g_signal_handlers_disconnect_by_func(gtk_icon_theme_get_default(), G_CALLBACK(theme_changed_cb), 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; } @@ -242,9 +247,12 @@ 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) { - g_signal_handlers_disconnect_by_func(gtk_icon_theme_get_default(), G_CALLBACK(theme_changed_cb), pdata->widget); + 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, NULL); + g_object_weak_unref(G_OBJECT(pdata->widget), widget_freed, pdata); } } @@ -286,7 +294,7 @@ 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, 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); -- cgit v1.2.3 -- cgit v1.2.3 From 633cd3f92e926b587b07dbc910b513d1daacf0f5 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Mar 2012 11:07:52 -0600 Subject: Restructuring slightly to have two cases, allocating memory and not allocating --- libdbusmenu-gtk/client.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 95d6b8b..9cb1144 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -735,27 +735,29 @@ process_a11y_desc (DbusmenuMenuitem * mi, GtkMenuItem * gmi, GVariant * variant, return; } - const gchar * setname = NULL; - const gchar * label = NULL; if (variant != NULL) { - setname = g_variant_get_string(variant, NULL); - } - + const gchar * setname = NULL; + setname = g_variant_dup_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. */ - if (setname == NULL) { + 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); + + atk_object_set_name(aobj, setname); + g_free(setname); } - atk_object_set_name(aobj, setname); return; } -- cgit v1.2.3 From b314d39809c37d6beff47389d3dfaedf058c0fcd Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Mar 2012 14:13:05 -0600 Subject: 0.5.94 --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index ddab2a6..ef691c6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ -AC_INIT(libdbusmenu, 0.5.93, ted@canonical.com) +AC_INIT(libdbusmenu, 0.5.94, ted@canonical.com) AC_COPYRIGHT([Copyright 2009,2010 Canonical]) AC_PREREQ(2.62) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libdbusmenu, 0.5.93, [-Wno-portability]) +AM_INIT_AUTOMAKE(libdbusmenu, 0.5.94, [-Wno-portability]) AM_MAINTAINER_MODE @@ -165,7 +165,7 @@ AC_PATH_PROG([XSLT_PROC], [xsltproc]) ########################### LIBDBUSMENU_CURRENT=4 -LIBDBUSMENU_REVISION=10 +LIBDBUSMENU_REVISION=11 LIBDBUSMENU_AGE=0 AC_SUBST(LIBDBUSMENU_CURRENT) -- cgit v1.2.3