summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-06-07 14:46:31 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2012-06-08 11:58:06 -0400
commita4cde607e4f432d60680201704e708c9d49513a9 (patch)
tree3dd6b2265f464845d4c28f22ce278aa94309f87d
parentabba18dad050a47b20d0bbd0b772a7c6abe9edad (diff)
downloadnautilus-a4cde607e4f432d60680201704e708c9d49513a9.tar.gz
a11y: make sure not to loop while looking for parent get_accessible
If the final class does not override the get_accessible method, it will inherit it from the parent class; what we're interested in is the first class for which get_accessible is != from our class get_accessible.
-rw-r--r--eel/eel-accessibility.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/eel/eel-accessibility.c b/eel/eel-accessibility.c
index 62249c9a5..95cbdaa54 100644
--- a/eel/eel-accessibility.c
+++ b/eel/eel-accessibility.c
@@ -118,13 +118,19 @@ eel_accessibility_create_accessible_gtype (const char *type_name,
GType atk_type, parent_atk_type;
GTypeQuery query;
AtkObject *parent_atk;
- GtkWidgetClass *parent_class;
+ GtkWidgetClass *parent_class, *klass;
if ((atk_type = g_type_from_name (type_name))) {
return atk_type;
}
- parent_class = g_type_class_peek_parent (G_OBJECT_GET_CLASS (widget));
+ klass = GTK_WIDGET_CLASS (G_OBJECT_GET_CLASS (widget));
+ parent_class = klass;
+
+ while (klass->get_accessible == parent_class->get_accessible) {
+ parent_class = g_type_class_peek_parent (parent_class);
+ }
+
parent_atk = parent_class->get_accessible (widget);
parent_atk_type = G_TYPE_FROM_INSTANCE (parent_atk);