IME: don't forward key-release without correspinding key-press

After commit e2189903 in wlroots, when ctrl-f is pressed in firefox with
a IME client running, the following key-release event for "f" is not
sent, thus "f" is repeated like "ffffffffff..." in the input box of
firefox. This is because the key-release event for "f" is firstly
forwarded to the IME client and then sent via the virtual keyboard created
by the IME client while the key-press event is sent via physical
keyboard, and with e2189903, key-release events without a corresponding
key-press event on the same keyboard is not emitted to the compositor.

So this commit fixes this problem by not forwarding the key-release event
to the IME client unless the corresponding key-press event was also
forwarded.
This commit is contained in:
tokyo4j 2024-12-17 12:06:05 +09:00 committed by Hiroaki Yamamoto
parent 5766bec70a
commit 683f67b761
2 changed files with 19 additions and 0 deletions

View file

@ -21,6 +21,7 @@ struct input_method_relay {
struct wl_list text_inputs; /* struct text_input.link */
struct wlr_input_method_v2 *input_method;
struct wlr_surface *focused_surface;
struct lab_set pressed_keys;
/*
* Text-input which is enabled by the client and communicating with
* input-method.