From 60cad018807fed82c507d78b9e560b116d2abe40 Mon Sep 17 00:00:00 2001 From: Takao Fujiwara Date: Tue, 1 Oct 2019 19:53:20 +0900 Subject: [PATCH] inputMethod: Do not change IBus.Capabilite by focus events gnome-shell calls ibus_input_context_focus_in() in InputMethod.focus_in() but the event is not actually forwarded to panels and engines in GNOME Wayland because gnome-shell changes IBus.Capabilite by focus events and disables IBus.Capabilite.FOCUS when ibus_input_context_focus_in() is called. IBus.Capabilite is assumed a fixed value per input context in the first place and it should not be changed by focus events. https://gitlab.gnome.org/GNOME/gnome-shell/issues/573 --- js/misc/inputMethod.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/js/misc/inputMethod.js b/js/misc/inputMethod.js index 811ba55fd..1ca70c3df 100644 --- a/js/misc/inputMethod.js +++ b/js/misc/inputMethod.js @@ -36,15 +36,7 @@ class InputMethod extends Clutter.InputMethod { } _updateCapabilities() { - let caps = 0; - - if (this.can_show_preedit) - caps |= IBus.Capabilite.PREEDIT_TEXT; - - if (this._currentFocus) - caps |= IBus.Capabilite.FOCUS | IBus.Capabilite.SURROUNDING_TEXT; - else - caps |= IBus.Capabilite.PREEDIT_TEXT | IBus.Capabilite.AUXILIARY_TEXT | IBus.Capabilite.LOOKUP_TABLE | IBus.Capabilite.PROPERTY; + let caps = IBus.Capabilite.PREEDIT_TEXT | IBus.Capabilite.FOCUS | IBus.Capabilite.SURROUNDING_TEXT; if (this._context) this._context.set_capabilities(caps); @@ -137,7 +129,6 @@ class InputMethod extends Clutter.InputMethod { this._currentFocus = focus; if (this._context) { this._context.focus_in(); - this._updateCapabilities(); this._emitRequestSurrounding(); } @@ -149,10 +140,8 @@ class InputMethod extends Clutter.InputMethod { vfunc_focus_out() { this._currentFocus = null; - if (this._context) { + if (this._context) this._context.focus_out(); - this._updateCapabilities(); - } if (this._preeditStr) { // Unset any preedit text