[mutter/wip/carlosg/input-method-fixes: 4/5] wayland: Reset ClutterInputFocus on focus changes




commit 39ff8d15e2f119082bdd5cfebf1ac41d022f4479
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Apr 22 18:06:39 2022 +0200

    wayland: Reset ClutterInputFocus on focus changes
    
    Focus changes should trigger an IM reset, as some engines do want
    to maybe commit the preedit string before changing focus. In addition,
    we do not want the preedit string to be able to move between
    windows/applications.
    
    Ensure that the commit string is committed when the IM deems so, and
    ensure we send a .done event disntinct to the .leave event, so that
    the client doesn't miss the commit.
    
    Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2030
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2384>

 src/wayland/meta-wayland-text-input.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/src/wayland/meta-wayland-text-input.c b/src/wayland/meta-wayland-text-input.c
index fc3d0619e4..f1fdc70c9f 100644
--- a/src/wayland/meta-wayland-text-input.c
+++ b/src/wayland/meta-wayland-text-input.c
@@ -343,6 +343,8 @@ meta_wayland_text_input_set_focus (MetaWaylandTextInput *text_input,
           if (clutter_input_focus_is_focused (focus))
             {
               input_method = clutter_backend_get_input_method (clutter_get_default_backend ());
+              clutter_input_focus_reset (focus);
+              meta_wayland_text_input_focus_flush_done (focus);
               clutter_input_method_focus_out (input_method);
             }
 


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