[gtk/ebassi/for-master: 3/4] a11y: Add missing fallback for accessible-role getter




commit 8157717e0375d526a110abc565ecb4c0a9fd1c89
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed Nov 11 19:36:38 2020 +0000

    a11y: Add missing fallback for accessible-role getter
    
    If the per-instance accessible role is unset, use the class role.

 gtk/gtkwidget.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
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;
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]