inputMethod: Clear preeditStr before reset

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 preedit change.

Fixes #4647
Fixes GNOME/gtk#4289
Fixes GNOME/gnome-builder#1536
Fixes GNOME/gnome-builder#1531

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1993>
This commit is contained in:
Christian Hergert 2021-09-29 12:46:45 -07:00 committed by Marge Bot
parent 2bcc6c09ed
commit 380d2db1d9

View File

@ -179,16 +179,16 @@ class InputMethod extends Clutter.InputMethod {
} }
vfunc_reset() { vfunc_reset() {
if (this._context) {
this._context.reset();
this._emitRequestSurrounding();
}
if (this._preeditStr !== null) { if (this._preeditStr !== null) {
// Unset any preedit text // Unset any preedit text
this.set_preedit_text(null, 0, Clutter.PreeditResetMode.CLEAR); this.set_preedit_text(null, 0, Clutter.PreeditResetMode.CLEAR);
this._preeditStr = null; this._preeditStr = null;
} }
if (this._context) {
this._context.reset();
this._emitRequestSurrounding();
}
} }
vfunc_set_cursor_location(rect) { vfunc_set_cursor_location(rect) {