[gtk+] a11y: Hack around infinite loops in parent setting
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] a11y: Hack around infinite loops in parent setting
- Date: Tue, 25 Oct 2011 11:39:42 +0000 (UTC)
commit b195c7dbb204403f8cb51a40151b9d39d38abafc
Author: Benjamin Otte <otte redhat com>
Date: Mon Oct 3 17:05:40 2011 +0200
a11y: Hack around infinite loops in parent setting
This is kind of a hack to get rid of infinite loops that occur when
child accessibles try to set their parent upon creation but the parent
accessible creates its children in the initialize vfunc. Because in that
case, the parent will not have an accessible set when the child tries to
access it, because it is still initializing itself. Which will cause a
new accessible to be created.
https://bugzilla.gnome.org/show_bug.cgi?id=660687
gtk/gtkwidget.c | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 8ebc2f5..8bc8c07 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -12088,19 +12088,27 @@ gtk_widget_real_get_accessible (GtkWidget *widget)
accessible =
atk_object_factory_create_accessible (factory,
G_OBJECT (widget));
+
+ if (priv->accessible_role != ATK_ROLE_INVALID)
+ atk_object_set_role (accessible, priv->accessible_role);
+
+ g_object_set_qdata (G_OBJECT (widget),
+ quark_accessible_object,
+ accessible);
}
else
{
accessible = g_object_new (priv->accessible_type, NULL);
- atk_object_initialize (accessible, widget);
- }
- if (priv->accessible_role != ATK_ROLE_INVALID)
- atk_object_set_role (accessible, priv->accessible_role);
+ if (priv->accessible_role != ATK_ROLE_INVALID)
+ atk_object_set_role (accessible, priv->accessible_role);
- g_object_set_qdata (G_OBJECT (widget),
- quark_accessible_object,
- accessible);
+ g_object_set_qdata (G_OBJECT (widget),
+ quark_accessible_object,
+ accessible);
+
+ atk_object_initialize (accessible, widget);
+ }
}
return accessible;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]