summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2021-04-21 10:20:04 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2021-04-21 10:22:20 +0100
commit8f9145109b1ae44f6a3c7a948b95bed8d9c203bd (patch)
tree4f749fb9cc047434c8304ba07e74a26d0b6f3e68
parent99750ac7ed27e490b0c143c083f9cb531ad5f111 (diff)
downloadgtk+-8f9145109b1ae44f6a3c7a948b95bed8d9c203bd.tar.gz
a11y: Pair window:activate with window:deactivate signal
Orca needs both events in order to decide whether or not to subscribe to other event/state changes in a window.
-rw-r--r--gtk/a11y/gtkatspicontext.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/gtk/a11y/gtkatspicontext.c b/gtk/a11y/gtkatspicontext.c
index 9f69b53181..7c5e967145 100644
--- a/gtk/a11y/gtkatspicontext.c
+++ b/gtk/a11y/gtkatspicontext.c
@@ -883,7 +883,8 @@ emit_focus (GtkAtSpiContext *self,
}
static void
-emit_window_activate (GtkAtSpiContext *self)
+emit_window_event (GtkAtSpiContext *self,
+ const char *event_type)
{
if (self->connection == NULL)
return;
@@ -892,9 +893,11 @@ emit_window_activate (GtkAtSpiContext *self)
NULL,
self->context_path,
"org.a11y.atspi.Event.Window",
- "activate",
+ event_type,
g_variant_new ("(siiva{sv})",
- "", 0, 0, g_variant_new_string("0"), NULL),
+ "", 0, 0,
+ g_variant_new_string("0"),
+ NULL),
NULL);
}
@@ -1134,8 +1137,16 @@ gtk_at_spi_context_platform_change (GtkATContext *ctx,
GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE);
emit_state_changed (self, "active", state);
- if (gtk_accessible_get_accessible_role (accessible) == GTK_ACCESSIBLE_ROLE_WINDOW && state)
- emit_window_activate (self);
+ /* Orca tracks the window:activate and window:deactivate events on top
+ * levels to decide whether to track other AT-SPI events
+ */
+ if (gtk_accessible_get_accessible_role (accessible) == GTK_ACCESSIBLE_ROLE_WINDOW)
+ {
+ if (state)
+ emit_window_event (self, "activate");
+ else
+ emit_window_event (self, "deactivate");
+ }
}
}