[gtk/gtk-4-2: 60/91] a11y: Pair window:activate with window:deactivate signal
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-4-2: 60/91] a11y: Pair window:activate with window:deactivate signal
- Date: Tue, 4 May 2021 02:05:41 +0000 (UTC)
commit 6a95ca699561047344f3399554977443c0d1e20b
Author: Emmanuele Bassi <ebassi gnome org>
Date: Wed Apr 21 10:20:04 2021 +0100
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.
gtk/a11y/gtkatspicontext.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/gtk/a11y/gtkatspicontext.c b/gtk/a11y/gtkatspicontext.c
index 8a8a46d2c6..10088a77e7 100644
--- a/gtk/a11y/gtkatspicontext.c
+++ b/gtk/a11y/gtkatspicontext.c
@@ -879,7 +879,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;
@@ -888,9 +889,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);
}
@@ -1130,8 +1133,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");
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]