[gtk/preedit-selection-fix: 4/8] text: Send anchor with surrounding




commit feccdad9d2afcda75d87153c48d3bc0324fa4bd8
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Mar 4 14:48:28 2021 -0500

    text: Send anchor with surrounding
    
    We have the api to do it now.

 gtk/gtktext.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index 3984750034..f2f1f854b0 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -4200,8 +4200,9 @@ gtk_text_retrieve_surrounding_cb (GtkIMContext *context,
 
   /* XXXX ??? does this even make sense when text is not visible? Should we return FALSE? */
   text = gtk_text_get_display_text (self, 0, -1);
-  gtk_im_context_set_surrounding (context, text, strlen (text), /* Length in bytes */
-                                  g_utf8_offset_to_pointer (text, priv->current_pos) - text);
+  gtk_im_context_set_surrounding_with_selection (context, text, strlen (text), /* Length in bytes */
+                                                 g_utf8_offset_to_pointer (text, priv->current_pos) - text,
+                                                 g_utf8_offset_to_pointer (text, priv->selection_bound) - 
text);
   g_free (text);
 
   return TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]