diff options
author | Ted Gould <ted@gould.cx> | 2012-03-21 14:27:09 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2012-03-21 14:27:09 -0500 |
commit | 6460e42cc9d14f03204e836b0f984102eac8159c (patch) | |
tree | 17fc215e733326c96649dc5eb8dc3ecdf5d45bed /libdbusmenu-gtk/client.c | |
parent | 588831fa1ac3390f08d0f40d6f7e0da6a969b99d (diff) | |
parent | ebab055ed741101f59c320367eb8be7484555a48 (diff) | |
download | libdbusmenu-6460e42cc9d14f03204e836b0f984102eac8159c.tar.gz libdbusmenu-6460e42cc9d14f03204e836b0f984102eac8159c.tar.bz2 libdbusmenu-6460e42cc9d14f03204e836b0f984102eac8159c.zip |
* 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
Diffstat (limited to 'libdbusmenu-gtk/client.c')
-rw-r--r-- | libdbusmenu-gtk/client.c | 19 |
1 files changed, 11 insertions, 8 deletions
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; |