diff options
author | Sebastien Bacher <seb128@ubuntu.com> | 2012-02-15 21:38:27 +0100 |
---|---|---|
committer | Sebastien Bacher <seb128@ubuntu.com> | 2012-02-15 21:38:27 +0100 |
commit | be1db87a7e1997e5dd1b69948136c30c7c39d960 (patch) | |
tree | f22ea28af5a331799fb6aca0c900a73e9a476720 /libdbusmenu-gtk/client.c | |
parent | ba23a1f5d6bed315132fb45ff7a63384e2da4e42 (diff) | |
parent | 49e45c8b23af0926ec04c50a4ac53068abba21db (diff) | |
download | libdbusmenu-be1db87a7e1997e5dd1b69948136c30c7c39d960.tar.gz libdbusmenu-be1db87a7e1997e5dd1b69948136c30c7c39d960.tar.bz2 libdbusmenu-be1db87a7e1997e5dd1b69948136c30c7c39d960.zip |
* debian/control:
- drop git binaries, the libdev depends on it
- set ubuntu vcs
- use the current vala version
[ Ted Gould ]
* New upstream release.
* Remove unused const on GStrv's
* Only free when there is data to free
* Ensure that we only return once even with error (LP: #929856)
* Fix an error on a failure to send properties (LP: #929707)
* Ensure the hash variant isn't NULL in the comparison (LP: #929710)
* Fix some of the issues with throwing criticals
* Ensure our tests fail if they throw criticals
* Parse and handle a11y descriptions
* Don't pass NULL to ATK
* Non-srcdir build fixes
Diffstat (limited to 'libdbusmenu-gtk/client.c')
-rw-r--r-- | libdbusmenu-gtk/client.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 9888cbe..830356a 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -725,6 +725,30 @@ process_disposition (DbusmenuMenuitem * mi, GtkMenuItem * gmi, GVariant * varian return; } +/* Process the accessible description */ +static void +process_a11y_desc (DbusmenuMenuitem * mi, GtkMenuItem * gmi, GVariant * variant, DbusmenuGtkClient * gtkclient) +{ + AtkObject * aobj = gtk_widget_get_accessible(GTK_WIDGET(gmi)); + + if (aobj == NULL) { + return; + } + + const gchar * setname = NULL; + + if (variant != NULL) { + setname = g_variant_get_string(variant, NULL); + } + + if (setname == NULL) { + setname = ""; + } + + atk_object_set_name(aobj, setname); + return; +} + /* Whenever we have a property change on a DbusmenuMenuitem we need to be responsive to that. */ static void @@ -747,8 +771,7 @@ menu_prop_change_cb (DbusmenuMenuitem * mi, gchar * prop, GVariant * variant, Db } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_DISPOSITION)) { process_disposition(mi, gmi, variant, gtkclient); } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC)) { - atk_object_set_name(gtk_widget_get_accessible(GTK_WIDGET(gmi)), variant == NULL ? NULL : - g_variant_get_string(variant, NULL)); + process_a11y_desc(mi, gmi, variant, gtkclient); } return; @@ -894,6 +917,7 @@ dbusmenu_gtkclient_newitem_base (DbusmenuGtkClient * client, DbusmenuMenuitem * process_toggle_state(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE)); process_submenu(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY), client); process_disposition(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_DISPOSITION), client); + process_a11y_desc(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC), client); refresh_shortcut(client, item); const gchar * a11y_desc = dbusmenu_menuitem_property_get(item, DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC); @@ -1128,12 +1152,7 @@ image_property_handle (DbusmenuMenuitem * item, const gchar * property, GVariant return; } - const gchar * value = NULL; - if (variant != NULL) { - value = g_variant_get_string(variant, NULL); - } - - if (value == NULL || value[0] == '\0') { + if (variant == NULL) { /* This means that we're unsetting a value. */ /* Try to use the other one */ if (g_strcmp0(property, DBUSMENU_MENUITEM_PROP_ICON_NAME)) { |