From 03819d755f5c8380b48bca51599981e205c066f4 Mon Sep 17 00:00:00 2001 From: Luke Yelavich Date: Wed, 1 Feb 2012 09:51:00 +1100 Subject: Fix up monitoring of the atk object, didn't understand that notification was the same as the GTK widgets as well. --- libdbusmenu-gtk/parser.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index 65a6b57..06eabba 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -607,7 +607,7 @@ construct_dbusmenu_for_widget (GtkWidget * widget) // so we had better watch out for it. pdata->accessible = accessible; g_signal_connect (G_OBJECT (accessible), - "accessible-name", + "notify", G_CALLBACK (a11y_name_notify_cb), mi); g_object_add_weak_pointer(G_OBJECT (accessible), (gpointer*)&pdata->accessible); @@ -994,10 +994,13 @@ a11y_name_notify_cb (AtkObject *accessible, * string as the text of the menu item label, in which case, we want to clear * the accessible description property of the dbusmenu item. */ - if (!g_strcmp0 (name, label_text)) - dbusmenu_menuitem_property_set (item, "accessible-desc", NULL); - else - dbusmenu_menuitem_property_set (item, "accessible-desc", name); + if (pspec->name == g_intern_static_string ("accessible-name")) + { + if (!g_strcmp0 (name, label_text)) + dbusmenu_menuitem_property_set (item, "accessible-desc", NULL); + else + dbusmenu_menuitem_property_set (item, "accessible-desc", name); + } } static void -- cgit v1.2.3