summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2018-11-13 18:26:13 +0100
committerCarlos Garnacho <carlosg@gnome.org>2018-11-13 18:52:15 +0100
commit8c3811a866017943c276fa7d9e2aed4c0f0554ae (patch)
treed6efbde68390ee44edb1e3fa3209a5058cadec08
parent118cab176623ced5d169d8363d4f4c6433d8c21f (diff)
downloadgnome-shell-8c3811a866017943c276fa7d9e2aed4c0f0554ae.tar.gz
inputMethod: Avoid calling set_preedit_text() if unnecessary
This is easier down on clients.
-rw-r--r--js/misc/inputMethod.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/js/misc/inputMethod.js b/js/misc/inputMethod.js
index 4a92dc49b..e22dfccc5 100644
--- a/js/misc/inputMethod.js
+++ b/js/misc/inputMethod.js
@@ -144,8 +144,11 @@ var InputMethod = new Lang.Class({
this._updateCapabilities();
}
- // Unset any preedit text
- this.set_preedit_text(null, 0);
+ if (this._preeditStr) {
+ // Unset any preedit text
+ this.set_preedit_text(null, 0);
+ this._preeditStr = null;
+ }
},
vfunc_reset() {
@@ -154,8 +157,11 @@ var InputMethod = new Lang.Class({
this._emitRequestSurrounding();
}
- // Unset any preedit text
- this.set_preedit_text(null, 0);
+ if (this._preeditStr) {
+ // Unset any preedit text
+ this.set_preedit_text(null, 0);
+ this._preeditStr = null;
+ }
},
vfunc_set_cursor_location(rect) {