Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

input method: don't forward key-release without correspinding key-press #2544

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tokyo4j
Copy link

@tokyo4j tokyo4j commented Dec 21, 2024

This PR follows the fix in labwc/labwc#2437.

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.

The video below is the demonstration of the regression in labwc, but it also happens in wayfire:

2024-12-16.16-13-45.mp4

This happens in the following flow:

  • The compositor receives key-press events for ctrl+f and sends them to Firefox
  • Firefox enables text_input for the input box
  • The compositor activates the IME client
  • The compositor receives a key-release event for "f", and forward it to the IME client
  • The IME client sends the key-release event for "f" to the compositor via a virtual keyboard, but wlroots ignores it because the key "f" has not been pressed in the virtual keyboard.
  • As firefox doesn't see the key-release event, its repeat timer timeouts and it starts printing "fffffffff...".

So this PR fixes this problem by not forwarding the key-release event to the IME client unless the corresponding key-press event has also been forwarded.

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 preceding 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.
@tokyo4j tokyo4j force-pushed the fix/firefox-fcitx5-key-repeat branch from 605a88e to 96f12f5 Compare December 21, 2024 17:27
@tokyo4j tokyo4j changed the title IME: don't forward key-release without correspinding key-press input method: don't forward key-release without correspinding key-press Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant