[gnome-shell/wip/carlosg/input-focus-anchor] inputMethod: Update to set_preedit_text() API change
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/carlosg/input-focus-anchor] inputMethod: Update to set_preedit_text() API change
- Date: Mon, 18 Jul 2022 13:16:01 +0000 (UTC)
commit d8b9423f019606a47d23e0fffd5fcb8e285cab4e
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Jul 18 15:11:49 2022 +0200
inputMethod: Update to set_preedit_text() API change
Since IBus does not provide this information right away, we
so far cannot do much about providing a truthful anchor position
for the preedit text. But with the Mutter API in place it will
be up to this object to do so in the future.
js/misc/inputMethod.js | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/js/misc/inputMethod.js b/js/misc/inputMethod.js
index 8c3cd61aeb..1215dcb20e 100644
--- a/js/misc/inputMethod.js
+++ b/js/misc/inputMethod.js
@@ -115,9 +115,9 @@ class InputMethod extends Clutter.InputMethod {
preedit = null;
if (visible)
- this.set_preedit_text(preedit, pos, mode);
+ this.set_preedit_text(preedit, pos, pos, mode);
else if (this._preeditVisible)
- this.set_preedit_text(null, pos, mode);
+ this.set_preedit_text(null, pos, pos, mode);
this._preeditStr = preedit;
this._preeditPos = pos;
@@ -127,11 +127,15 @@ class InputMethod extends Clutter.InputMethod {
_onShowPreeditText() {
this._preeditVisible = true;
- this.set_preedit_text(this._preeditStr, this._preeditPos, this._preeditCommitMode);
+ this.set_preedit_text(
+ this._preeditStr, this._preeditPos, this._preeditPos,
+ this._preeditCommitMode);
}
_onHidePreeditText() {
- this.set_preedit_text(null, this._preeditPos, this._preeditCommitMode);
+ this.set_preedit_text(
+ null, this._preeditPos, this._preeditPos,
+ this._preeditCommitMode);
this._preeditVisible = false;
}
@@ -169,7 +173,7 @@ class InputMethod extends Clutter.InputMethod {
if (this._preeditStr && this._preeditVisible) {
// Unset any preedit text
- this.set_preedit_text(null, 0, this._preeditCommitMode);
+ this.set_preedit_text(null, 0, 0, this._preeditCommitMode);
this._preeditStr = null;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]