From e2067e370362da055660fdcce1f8bc0408c5f04c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 28 Jun 2024 08:16:26 -0400 Subject: [PATCH] text: Move a11y selection updates where they belong gtk_text_set_positions is the central place for any changes to text caret and selection bound. And it already filters out no-change updates. So move the remaining signals from gtk_text_set_selection_bounds here, for more accurate updates of cursor positions in accessibility. Fixes: #6805 --- gtk/gtktext.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gtk/gtktext.c b/gtk/gtktext.c index a59e8baf72..c44b1edfbc 100644 --- a/gtk/gtktext.c +++ b/gtk/gtktext.c @@ -3565,11 +3565,6 @@ gtk_text_set_selection_bounds (GtkText *self, gtk_text_reset_im_context (self); gtk_text_set_positions (self, MIN (end, length), MIN (start, length)); - - gtk_text_update_primary_selection (self); - - gtk_accessible_text_update_caret_position (GTK_ACCESSIBLE_TEXT (self)); - gtk_accessible_text_update_selection_bound (GTK_ACCESSIBLE_TEXT (self)); } static gboolean @@ -4578,6 +4573,10 @@ gtk_text_set_positions (GtkText *self, { gtk_text_update_clipboard_actions (self); gtk_text_recompute (self); + + gtk_text_update_primary_selection (self); + gtk_accessible_text_update_caret_position (GTK_ACCESSIBLE_TEXT (self)); + gtk_accessible_text_update_selection_bound (GTK_ACCESSIBLE_TEXT (self)); } }