summaryrefslogtreecommitdiff
path: root/gtk/a11y
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-10-20 21:31:23 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-10-20 21:31:23 -0400
commite20a3339bfdf69c23f036024692c710812d5154a (patch)
treebb330dafecb150471c5af27d11a8698132caa2d6 /gtk/a11y
parenta8baee342c943aa77ad03035e70de5ebd9906ce7 (diff)
downloadgtk+-e20a3339bfdf69c23f036024692c710812d5154a.tar.gz
atsi: Fix emission of text selection changes
We were not emitting text-selection-changed and text-caret-moved as expected.
Diffstat (limited to 'gtk/a11y')
-rw-r--r--gtk/a11y/gtkatspicontext.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/gtk/a11y/gtkatspicontext.c b/gtk/a11y/gtkatspicontext.c
index a72a6ad40e..b030d1cfd7 100644
--- a/gtk/a11y/gtkatspicontext.c
+++ b/gtk/a11y/gtkatspicontext.c
@@ -729,14 +729,24 @@ emit_text_selection_changed (GtkAtSpiContext *self,
const char *kind,
int cursor_position)
{
- g_dbus_connection_emit_signal (self->connection,
- NULL,
- self->context_path,
- "org.a11y.atspi.Event.Object",
- "TextChanged",
- g_variant_new ("(siiva{sv})",
- kind, cursor_position, 0, g_variant_new_string (""), NULL),
+ if (strcmp (kind, "text-caret-moved") == 0)
+ g_dbus_connection_emit_signal (self->connection,
+ NULL,
+ self->context_path,
+ "org.a11y.atspi.Event.Object",
+ "TextCaretMoved",
+ g_variant_new ("(siiva{sv})",
+ "", cursor_position, 0, g_variant_new_string (""), NULL),
NULL);
+ else
+ g_dbus_connection_emit_signal (self->connection,
+ NULL,
+ self->context_path,
+ "org.a11y.atspi.Event.Object",
+ "TextSelectionChanged",
+ g_variant_new ("(siiva{sv})",
+ "", 0, 0, g_variant_new_string (""), NULL),
+ NULL);
}
static void