diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2020-11-11 19:36:38 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2020-11-11 19:45:43 +0000 |
commit | 8157717e0375d526a110abc565ecb4c0a9fd1c89 (patch) | |
tree | 27aa1d3f6d468e04f6234981dd33f2262624cecf | |
parent | 9052f6dafe15082aa05e25c0267b30f668488e9f (diff) | |
download | gtk+-8157717e0375d526a110abc565ecb4c0a9fd1c89.tar.gz |
a11y: Add missing fallback for accessible-role getter
If the per-instance accessible role is unset, use the class role.
-rw-r--r-- | gtk/gtkwidget.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 7c848040e3..4199ffd52d 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -12607,11 +12607,17 @@ gtk_widget_get_accessible_role (GtkWidget *self) { GtkWidgetPrivate *priv = gtk_widget_get_instance_private (self); GtkATContext *context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (self)); + GtkWidgetClassPrivate *class_priv; if (context != NULL && gtk_at_context_is_realized (context)) return gtk_at_context_get_accessible_role (context); - return priv->accessible_role; + if (priv->accessible_role != GTK_ACCESSIBLE_ROLE_WIDGET) + return priv->accessible_role; + + class_priv = GTK_WIDGET_GET_CLASS (self)->priv; + + return class_priv->accessible_role; } /** |