[mutter/wip/carlosg/input-focus-anchor: 5/5] clutter: Let ClutterInputMethods pass the anchor position for preedit text




commit f685567afe31e1ad590d96d184806ba626decd70
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Jul 18 15:07:49 2022 +0200

    clutter: Let ClutterInputMethods pass the anchor position for preedit text
    
    This is an API break, since users (i.e. GNOME Shell) provide the input method
    implementation.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2517>

 clutter/clutter/clutter-input-method.c | 3 ++-
 clutter/clutter/clutter-input-method.h | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/clutter/clutter/clutter-input-method.c b/clutter/clutter/clutter-input-method.c
index 8b5828773c..75b282c71a 100644
--- a/clutter/clutter/clutter-input-method.c
+++ b/clutter/clutter/clutter-input-method.c
@@ -359,12 +359,13 @@ void
 clutter_input_method_set_preedit_text (ClutterInputMethod      *im,
                                        const gchar             *preedit,
                                        unsigned int             cursor,
+                                       unsigned int             anchor,
                                        ClutterPreeditResetMode  mode)
 {
   g_return_if_fail (CLUTTER_IS_INPUT_METHOD (im));
 
   clutter_input_method_put_im_event (im, CLUTTER_IM_PREEDIT, preedit,
-                                     cursor, cursor, 0, mode);
+                                     cursor, anchor, 0, mode);
 }
 
 void
diff --git a/clutter/clutter/clutter-input-method.h b/clutter/clutter/clutter-input-method.h
index cc11545c8c..34d48ec5e9 100644
--- a/clutter/clutter/clutter-input-method.h
+++ b/clutter/clutter/clutter-input-method.h
@@ -77,6 +77,7 @@ CLUTTER_EXPORT
 void clutter_input_method_set_preedit_text (ClutterInputMethod      *im,
                                             const gchar             *preedit,
                                             unsigned int             cursor,
+                                            unsigned int             anchor,
                                             ClutterPreeditResetMode  mode);
 
 CLUTTER_EXPORT


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