widget: fix GtkLabelAccessible NULL links.

Fix testsuite/a11y/about.ui GtkAboutDialog :
"CRITICAL **: atk_hyperlink_get_start_index: assertion 'ATK_IS_HYPERLINK (link)' failed"
That is set widget->priv->accessible as soon as accessible object is generated.

When accessible object is created accessible->priv->widget is set,
if widget->priv->accessible is not , then _gtk_label_accessible_update_links
exits early, thus without creating the links on the accessible side.
(This as it checks for the widget to have the accessible set before proceeding).

https://bugzilla.gnome.org/show_bug.cgi?id=766458
This commit is contained in:
Alban Browaeys 2016-05-14 23:57:28 +02:00 committed by Matthias Clasen
parent ddcf47026d
commit cd305c1970

View File

@ -13417,6 +13417,8 @@ gtk_widget_real_get_accessible (GtkWidget *widget)
if (priv->accessible_role != ATK_ROLE_INVALID)
atk_object_set_role (accessible, priv->accessible_role);
widget->priv->accessible = accessible;
}
else
{
@ -13426,6 +13428,8 @@ gtk_widget_real_get_accessible (GtkWidget *widget)
if (priv->accessible_role != ATK_ROLE_INVALID)
atk_object_set_role (accessible, priv->accessible_role);
widget->priv->accessible = accessible;
atk_object_initialize (accessible, widget);
/* Set the role again, since we don't want a role set
@ -13436,7 +13440,6 @@ gtk_widget_real_get_accessible (GtkWidget *widget)
atk_object_set_role (accessible, priv->accessible_role);
}
widget->priv->accessible = accessible;
}
return accessible;