a11y: More State<>Change confusion

We should really avoid this needless duplication
- the 'state' is never stored anywhere.
This commit is contained in:
Matthias Clasen
2020-10-24 23:12:36 -04:00
parent 8ffb398517
commit adb7676fc1
2 changed files with 15 additions and 2 deletions

View File

@@ -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,

View File

@@ -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