summaryrefslogtreecommitdiff
path: root/eel/eel-accessibility.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-06-07 14:46:31 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2012-06-07 14:46:31 -0400
commitf2c748dc0610272a8430d81f69156d3ae391fb18 (patch)
treef44b5b12b2301899c80d66b9863084a90522ea08 /eel/eel-accessibility.c
parentccdd920501fb9c5f70437990d3d3017954fe2e1c (diff)
downloadnautilus-f2c748dc0610272a8430d81f69156d3ae391fb18.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.
Diffstat (limited to 'eel/eel-accessibility.c')
-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);