[gtk/a11y-debug] a11y: Emit window:activate event
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/a11y-debug] a11y: Emit window:activate event
- Date: Tue, 20 Apr 2021 16:25:05 +0000 (UTC)
commit 639932ad8a93157628937d03c2da72edfd853bf8
Author: Emmanuele Bassi <ebassi gnome org>
Date: Tue Apr 20 17:24:13 2021 +0100
a11y: Emit window:activate event
Orca uses the window:activate event type to track top levels, and avoid
being spammed by events coming from non-focused windows.
gtk/a11y/gtkatspicontext.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
---
diff --git a/gtk/a11y/gtkatspicontext.c b/gtk/a11y/gtkatspicontext.c
index c15c4d37b9..9f69b53181 100644
--- a/gtk/a11y/gtkatspicontext.c
+++ b/gtk/a11y/gtkatspicontext.c
@@ -882,6 +882,22 @@ emit_focus (GtkAtSpiContext *self,
NULL);
}
+static void
+emit_window_activate (GtkAtSpiContext *self)
+{
+ if (self->connection == NULL)
+ return;
+
+ g_dbus_connection_emit_signal (self->connection,
+ NULL,
+ self->context_path,
+ "org.a11y.atspi.Event.Window",
+ "activate",
+ g_variant_new ("(siiva{sv})",
+ "", 0, 0, g_variant_new_string("0"), NULL),
+ NULL);
+}
+
static void
gtk_at_spi_context_state_change (GtkATContext *ctx,
GtkAccessibleStateChange changed_states,
@@ -1117,6 +1133,9 @@ gtk_at_spi_context_platform_change (GtkATContext *ctx,
gboolean state = gtk_accessible_get_platform_state (GTK_ACCESSIBLE (widget),
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);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]