[gtk/wip/ebassi/a11y-drop-atk: 6/7] Update the accessible state on widget visibility changes



commit bf792c9f9fc3b5a1443f51da177add1b58ec45e5
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Jul 7 17:51:01 2020 +0100

    Update the accessible state on widget visibility changes
    
    The GTK_ACCESSIBLE_STATE_HIDDEN has the opposite meaning of the
    GtkWidget:visible property.

 gtk/gtkwidget.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index d32e3d3174..ab6f9892b5 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -2579,6 +2579,10 @@ gtk_widget_show (GtkWidget *widget)
       g_signal_emit (widget, widget_signals[SHOW], 0);
       g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_VISIBLE]);
 
+      gtk_accessible_update_state (GTK_ACCESSIBLE (widget),
+                                   GTK_ACCESSIBLE_STATE_HIDDEN, FALSE,
+                                   -1);
+
       gtk_widget_pop_verify_invariants (widget);
       g_object_unref (widget);
     }
@@ -2639,6 +2643,10 @@ gtk_widget_hide (GtkWidget *widget)
       g_signal_emit (widget, widget_signals[HIDE], 0);
       g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_VISIBLE]);
 
+      gtk_accessible_update_state (GTK_ACCESSIBLE (widget),
+                                   GTK_ACCESSIBLE_STATE_HIDDEN, TRUE,
+                                   -1);
+
       parent = gtk_widget_get_parent (widget);
       if (parent)
        gtk_widget_queue_resize (parent);


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