From cd305c19702cc80f900a0922bce19bf0c926167a Mon Sep 17 00:00:00 2001 From: Alban Browaeys Date: Sat, 14 May 2016 23:57:28 +0200 Subject: [PATCH] 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 --- gtk/gtkwidget.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index c14e127be6..36752b4fdb 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -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;