searchController: Let an input method process key events

It is expected that users can select a candidate using the keyboard when
an input method shows preedit text and optionally a candidate popup.
To enable this, every key event needs to be propagated if the search
entry has preedit text.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7606
This commit is contained in:
Shiki Okasaka 2024-04-24 18:37:29 +09:00
parent a86925293f
commit d7603d5391

View file

@ -269,6 +269,9 @@ export const SearchController = GObject.registerClass({
}
_onKeyPress(entry, event) {
if (this._text.has_preedit())
return Clutter.EVENT_PROPAGATE;
let symbol = event.get_key_symbol();
if (symbol === Clutter.KEY_Escape) {
if (this._isActivated()) {