[gnome-shell/wip/carlosg/im-full-reset: 3/5] keyboard: Synchronize input method state after toggling completion
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/carlosg/im-full-reset: 3/5] keyboard: Synchronize input method state after toggling completion
- Date: Mon, 17 Oct 2022 14:20:02 +0000 (UTC)
commit ebff36986ab7f41ad6c1e6f6051cc78808e13417
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Oct 17 13:31:45 2022 +0200
keyboard: Synchronize input method state after toggling completion
Make the input method synchronize its state after the engine changes
resulting from completion being toggled.
js/misc/inputMethod.js | 11 +++++++++++
js/ui/keyboard.js | 4 ++--
2 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/js/misc/inputMethod.js b/js/misc/inputMethod.js
index 054096589a..ed680ec045 100644
--- a/js/misc/inputMethod.js
+++ b/js/misc/inputMethod.js
@@ -343,4 +343,15 @@ var InputMethod = GObject.registerClass({
this._context.process_key_event_async(
keyval, 0, IBus.ModifierType.RELEASE_MASK, -1, null, null);
}
+
+ update() {
+ if (!this._context)
+ return;
+ this._updateCapabilities();
+ this._context.set_content_type(this._purpose, this._hints);
+ this._context.set_cursor_location(
+ this._cursorRect.x, this._cursorRect.y,
+ this._cursorRect.width, this._cursorRect.height);
+ this._emitRequestSurrounding();
+ }
});
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 895691c34e..fd57ce811b 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -1889,7 +1889,7 @@ var Keyboard = GObject.registerClass({
}
this._oskCompletionEnabled =
- IBusManager.getIBusManager().setCompletionEnabled(true);
+ IBusManager.getIBusManager().setCompletionEnabled(true, () => Main.inputMethod.update());
this._clearKeyboardRestTimer();
if (immediate) {
@@ -1924,7 +1924,7 @@ var Keyboard = GObject.registerClass({
if (!this._keyboardVisible)
return;
- IBusManager.getIBusManager().setCompletionEnabled(false);
+ IBusManager.getIBusManager().setCompletionEnabled(false, () => Main.inputMethod.update ());
this._oskCompletionEnabled = false;
this._clearKeyboardRestTimer();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]