[gtk/matthiasc/atspi-child] Cosmetics



commit 7c106578ed37819bb48fc6d33a4bcb83fc6fa77b
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Oct 24 21:35:35 2020 -0400

    Cosmetics
    
    Make gtk_at_spi_root_child_changed take a
    GtkAccessible for the child.

 gtk/a11y/gtkatspiroot.c        | 13 ++++---------
 gtk/a11y/gtkatspirootprivate.h |  2 +-
 2 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/gtk/a11y/gtkatspiroot.c b/gtk/a11y/gtkatspiroot.c
index a68d9cac40..9aec9af186 100644
--- a/gtk/a11y/gtkatspiroot.c
+++ b/gtk/a11y/gtkatspiroot.c
@@ -408,7 +408,7 @@ static const GDBusInterfaceVTable root_accessible_vtable = {
 void
 gtk_at_spi_root_child_changed (GtkAtSpiRoot             *self,
                                GtkAccessibleChildState   state,
-                               GtkWidget                *window)
+                               GtkAccessible            *child)
 {
   guint n, i;
   int idx = 0;
@@ -417,18 +417,13 @@ gtk_at_spi_root_child_changed (GtkAtSpiRoot             *self,
   if (!self->toplevels)
     return;
 
-  /* We can be called either with a valid position and window == NULL
-   * or with position == G_MAXUINT and a valid window. In both cases,
-   * we need to determine the index of where the removed object would
-   * have been in the accessible tree.
-   */
   for (i = 0, n = g_list_model_get_n_items (self->toplevels); i < n; i++)
     {
       GtkAccessible *item = g_list_model_get_item (self->toplevels, i);
 
       g_object_unref (item);
 
-      if (item == GTK_ACCESSIBLE (window))
+      if (item == child)
         break;
 
       if (!gtk_accessible_should_present (item))
@@ -437,13 +432,13 @@ gtk_at_spi_root_child_changed (GtkAtSpiRoot             *self,
       idx++;
     }
 
-  if (window == NULL)
+  if (child == NULL)
     {
       window_ref = gtk_at_spi_null_ref ();
     }
   else
     {
-      GtkATContext *context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (window));
+      GtkATContext *context = gtk_accessible_get_at_context (child);
 
       window_ref = gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (context));
     }
diff --git a/gtk/a11y/gtkatspirootprivate.h b/gtk/a11y/gtkatspirootprivate.h
index 7f4f062afc..c4046c35e5 100644
--- a/gtk/a11y/gtkatspirootprivate.h
+++ b/gtk/a11y/gtkatspirootprivate.h
@@ -45,6 +45,6 @@ gtk_at_spi_root_to_ref (GtkAtSpiRoot *self);
 void
 gtk_at_spi_root_child_changed (GtkAtSpiRoot             *self,
                                GtkAccessibleChildState   state,
-                               GtkWidget                *window);
+                               GtkAccessible            *child);
 
 G_END_DECLS


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