[gtk/matthiasc/atspi-child] a11y: More State<>Change confusion



commit adb7676fc1464fe34a2e25806e3b7b26a9de62eb
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Oct 24 23:12:36 2020 -0400

    a11y: More State<>Change confusion
    
    We should really avoid this needless duplication
    - the 'state' is never stored anywhere.

 gtk/a11y/gtkatspiroot.c        | 15 ++++++++++++++-
 gtk/a11y/gtkatspirootprivate.h |  2 +-
 2 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/gtk/a11y/gtkatspiroot.c b/gtk/a11y/gtkatspiroot.c
index 9aec9af186..c4c09bdae1 100644
--- a/gtk/a11y/gtkatspiroot.c
+++ b/gtk/a11y/gtkatspiroot.c
@@ -407,12 +407,13 @@ static const GDBusInterfaceVTable root_accessible_vtable = {
 
 void
 gtk_at_spi_root_child_changed (GtkAtSpiRoot             *self,
-                               GtkAccessibleChildState   state,
+                               GtkAccessibleChildChange  change,
                                GtkAccessible            *child)
 {
   guint n, i;
   int idx = 0;
   GVariant *window_ref;
+  GtkAccessibleChildState state;
 
   if (!self->toplevels)
     return;
@@ -443,6 +444,18 @@ gtk_at_spi_root_child_changed (GtkAtSpiRoot             *self,
       window_ref = gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (context));
     }
 
+  switch (change)
+    {
+    case GTK_ACCESSIBLE_CHILD_CHANGE_ADDED:
+      state = GTK_ACCESSIBLE_CHILD_STATE_ADDED;
+      break;
+    case GTK_ACCESSIBLE_CHILD_CHANGE_REMOVED:
+      state = GTK_ACCESSIBLE_CHILD_STATE_REMOVED;
+      break;
+    default:
+      g_assert_not_reached ();
+    }
+
   gtk_at_spi_emit_children_changed (self->connection,
                                     self->root_path,
                                     state,
diff --git a/gtk/a11y/gtkatspirootprivate.h b/gtk/a11y/gtkatspirootprivate.h
index c4046c35e5..f5ae272999 100644
--- a/gtk/a11y/gtkatspirootprivate.h
+++ b/gtk/a11y/gtkatspirootprivate.h
@@ -44,7 +44,7 @@ gtk_at_spi_root_to_ref (GtkAtSpiRoot *self);
 
 void
 gtk_at_spi_root_child_changed (GtkAtSpiRoot             *self,
-                               GtkAccessibleChildState   state,
+                               GtkAccessibleChildChange  change,
                                GtkAccessible            *child);
 
 G_END_DECLS


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