st-widget: Fix a potentially infinite recursion

Commit ffe4eaf00d changed this code to
call st_widget_get_accessible_role() instead of using the value
directly which would be an infinite recursion if that function didn't
have a bug. As it is, this just resulted in

CRITICAL **: atk_object_get_role: assertion 'ATK_IS_OBJECT
(accessible)' failed

https://bugzilla.gnome.org/show_bug.cgi?id=760945
This commit is contained in:
Rui Matos 2016-01-21 16:39:58 +01:00
parent f9258bb5e3
commit b87da87252

View File

@ -2785,7 +2785,7 @@ static AtkRole
st_widget_accessible_get_role (AtkObject *obj)
{
StWidget *widget = NULL;
AtkRole role;
StWidgetPrivate *priv;
g_return_val_if_fail (ST_IS_WIDGET_ACCESSIBLE (obj), ATK_ROLE_INVALID);
@ -2794,9 +2794,9 @@ st_widget_accessible_get_role (AtkObject *obj)
if (widget == NULL)
return ATK_ROLE_INVALID;
role = st_widget_get_accessible_role (widget);
if (role != ATK_ROLE_INVALID)
return role;
priv = st_widget_get_instance_private (widget);
if (priv->accessible_role != ATK_ROLE_INVALID)
return priv->accessible_role;
return ATK_OBJECT_CLASS (st_widget_accessible_parent_class)->get_role (obj);
}