Repository navigation
Conversation
…nable state
set_focus() currently skips text inputs that are not enabled yet. However,
per the text-input-unstable-v3 protocol a client enables text input only
after it receives the enter event ("requests text input on the surface
previously obtained from the enter event"). The only other path that sends
enter is on_text_input_new, and only when the surface is already focused at
that moment (WayfireWM#2113), so a text input created before the surface gains focus
is never entered and never enabled.
This breaks clients that create their zwp_text_input_v3 before focus (Qt apps
such as Featherpad, Chromium, kitty): the input method (e.g. fcitx5) never
activates and stays at focus:0.
Send enter to the focused surface's text input on focus change regardless of
current_enabled; the client then enables itself and on_text_input_enable
activates the input method. This complements the WayfireWM#2113 case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
I'm using a pure text-input-v3 and input-method-v2 configuration.
The compositor (wayfire), the input method (fcitx) and all the applications I'm using are all advertising only these two protocol versions.
The problem I encounter is that for nearly all applications, the input method never activates.
AI analysis identified the root cause: clients that create their
zwp_text_input_v3object before their surface gains keyboard focus never enable text input.Example applications affected: featherpad, chromium, kitty.
Detailed Cause Analysis
input_method_relay::set_focus()skips text inputs that are not yet enabled:Per
text-input-unstable-v3,enablerequests text input "on the surface previously obtained from theenterevent" — the client enables after it receivesenter. The only otherenterpath ison_text_input_new, which only fires when the surface is already focused at that moment (#2113). So a text input created before focus is never entered and never enabled.Reproduction
WAYLAND_DEBUG=1 featherpad(or chromium/kitty) with fcitx5 running:No
enterfrom the compositor, noenable()from the client, fcitx5'sInputContextstaysfocus:0.Fix
Send
enterto the focused surface's text input on focus change regardless ofcurrent_enabled. The client then enables itself;on_text_input_enableactivates the input method. This complements the #2113 case (text input created after focus).I don't quite understand the code change, but after this patch, all my applications are able to use fcitx with Ctrl+Space. I haven't found any side effects so far.
I am willing to test on my system (Gentoo) whether this patch introduces any other problems.