[gnome-shell/wip/chergert/fix-4647] inputMethod: clear preeditStr before reseting context




commit e99cbe43d3a77d53038843a875ec52d415eb4e39
Author: Christian Hergert <chergert redhat com>
Date:   Wed Sep 29 12:46:45 2021 -0700

    inputMethod: clear preeditStr before reseting context
    
    Previously, these were performed in a different order before GNOME 41.
    During some other changes they were swapped.
    
    However, this causes both GTK 3 and GTK 4 applications to scroll to
    incorrect positions from the predit change.
    
    Fixes #4647
    Fixes GNOME/gtk#4289
    Fixes GNOME/gnome-builder#1536
    Fixes GNOME/gnome-builder#1531

 js/misc/inputMethod.js | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/js/misc/inputMethod.js b/js/misc/inputMethod.js
index 25b02e35b8..1f9eaee7a8 100644
--- a/js/misc/inputMethod.js
+++ b/js/misc/inputMethod.js
@@ -179,16 +179,16 @@ class InputMethod extends Clutter.InputMethod {
     }
 
     vfunc_reset() {
+        if (this._context) {
+            this._context.reset();
+            this._emitRequestSurrounding();
+        }
+
         if (this._preeditStr !== null) {
             // Unset any preedit text
             this.set_preedit_text(null, 0, Clutter.PreeditResetMode.CLEAR);
             this._preeditStr = null;
         }
-
-        if (this._context) {
-            this._context.reset();
-            this._emitRequestSurrounding();
-        }
     }
 
     vfunc_set_cursor_location(rect) {


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