diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-04-19 21:29:17 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-04-19 21:29:17 -0400 |
commit | ae83b799848c45632a713477a38b36e940982488 (patch) | |
tree | 73ff51116885dd301cfec4962112b59fbcebdda9 | |
parent | 5f2c08cef1683d9f998548db4f614a524c429f03 (diff) | |
download | gtk+-ae83b799848c45632a713477a38b36e940982488.tar.gz |
a11y: Emit focus events
Orca relies on these to keep track of the focus location,
ignoring the focused state. With this change, orca can
once again speak text in entries as I type.
-rw-r--r-- | gtk/a11y/gtkatspicontext.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gtk/a11y/gtkatspicontext.c b/gtk/a11y/gtkatspicontext.c index 9891a4da69..c15c4d37b9 100644 --- a/gtk/a11y/gtkatspicontext.c +++ b/gtk/a11y/gtkatspicontext.c @@ -865,6 +865,24 @@ emit_children_changed (GtkAtSpiContext *self, } static void +emit_focus (GtkAtSpiContext *self, + gboolean focus_in) +{ + if (self->connection == NULL) + return; + + if (focus_in) + g_dbus_connection_emit_signal (self->connection, + NULL, + self->context_path, + "org.a11y.atspi.Event.Focus", + "Focus", + 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, GtkAccessiblePropertyChange changed_properties, @@ -1091,6 +1109,7 @@ gtk_at_spi_context_platform_change (GtkATContext *ctx, gboolean state = gtk_accessible_get_platform_state (GTK_ACCESSIBLE (widget), GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED); emit_state_changed (self, "focused", state); + emit_focus (self, state); } if (changed_platform & GTK_ACCESSIBLE_PLATFORM_CHANGE_ACTIVE) |