inputMethod: Avoid calling set_preedit_text() if unnecessary

This is easier down on clients.

(cherry-picked from 8c3811a866)
This commit is contained in:
Carlos Garnacho 2018-11-13 18:26:13 +01:00
parent e23f4d6c7c
commit 4010628001

View File

@ -144,8 +144,11 @@ var InputMethod = new Lang.Class({
this._updateCapabilities(); this._updateCapabilities();
} }
// Unset any preedit text if (this._preeditStr) {
this.set_preedit_text(null, 0); // Unset any preedit text
this.set_preedit_text(null, 0);
this._preeditStr = null;
}
}, },
vfunc_reset() { vfunc_reset() {
@ -154,8 +157,11 @@ var InputMethod = new Lang.Class({
this._emitRequestSurrounding(); this._emitRequestSurrounding();
} }
// Unset any preedit text if (this._preeditStr) {
this.set_preedit_text(null, 0); // Unset any preedit text
this.set_preedit_text(null, 0);
this._preeditStr = null;
}
}, },
vfunc_set_cursor_location(rect) { vfunc_set_cursor_location(rect) {