From 2b0ae4bad358a467da05cf0e16acb2adf3e6a1c1 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 30 Jul 2014 23:09:51 +0200 Subject: [PATCH] GtkPopover: Properly update a11y parent When the relative-to widget changes, update the accessible parent of the popovers accessible. https://bugzilla.gnome.org/show_bug.cgi?id=733923 --- gtk/a11y/gtkpopoveraccessible.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/gtk/a11y/gtkpopoveraccessible.c b/gtk/a11y/gtkpopoveraccessible.c index 55eaaed9c6..63bceab014 100644 --- a/gtk/a11y/gtkpopoveraccessible.c +++ b/gtk/a11y/gtkpopoveraccessible.c @@ -61,6 +61,13 @@ popover_update_relative_to (AtkObject *obj, if (widget) { + AtkObject *parent; + + parent = gtk_widget_get_accessible (widget); + + if (parent) + atk_object_set_parent (obj, parent); + g_object_add_weak_pointer (G_OBJECT (priv->widget), (gpointer*) &priv->widget); widget_accessible = gtk_widget_get_accessible (widget); @@ -97,18 +104,10 @@ static void gtk_popover_accessible_initialize (AtkObject *obj, gpointer data) { - GtkPopover *popover; - AtkObject *parent; + GtkPopover *popover = GTK_POPOVER (data); ATK_OBJECT_CLASS (gtk_popover_accessible_parent_class)->initialize (obj, data); - popover = GTK_POPOVER (data); - - parent = gtk_widget_get_accessible (gtk_popover_get_relative_to (popover)); - - if (parent) - atk_object_set_parent (obj, parent); - g_signal_connect (popover, "notify", G_CALLBACK (popover_notify_cb), obj); popover_update_relative_to (obj, popover);