Repository navigation
protocols/text-input-v3: send done in response to every commit - #16571
Closed
hjanuschka wants to merge 1 commit into
Closed
hjanuschka wants to merge 1 commit into
hjanuschka wants to merge 1 commit into
Conversation
The done event was only sent from updateIMEState, i.e. when the input method pushes preedit/commit back to the client. Per the protocol spec, clients must withhold all pending state (set_cursor_rectangle, set_surrounding_text, set_content_type) until they receive a done event with a serial matching their commit count. Clients implementing this strictly (e.g. Chromium) could therefore never update the cursor rectangle after their first commit unless the IME happened to push state, leaving IME candidate popups anchored to a stale rectangle. Ack every commit with done(serial) in the protocol handler, which also covers the case where no IME is attached at all.
|
Hi @hjanuschka, Thanks for your contribution! Unfortunately, Hyprland and hypr* no longer To get vouched, please see our contributing guide at wiki.hypr.land/Contributing-and-Debugging This PR has been closed automatically and will not be re-opened. |
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.
Describe your PR, what does it fix/add?
zwp_text_input_v3.donewas only sent fromupdateIMEState, i.e. when the input method pushes preedit/commit back to the client. The protocol spec requires clients to withhold all pending state until they receive adonewith a serial matching their commit count:Clients implementing this strictly (e.g. Chromium, which gates on
done_serial == commit_count) can therefore never update the cursor rectangle after their first commit unless the IME happens to push state back. Observable result with Chromium + fcitx5 on Hyprland: the IME candidate popup opens anchored to a stale rectangle (often the initial 0,0) and only corrects itself after a focus leave/enter (e.g. fullscreen toggle), because that is the only moment Chromium can bundle the current rectangle withenable.This sends
done(serial)in response to every commit in the protocol handler, which also covers the case where no IME is attached. The later IME-drivendonefromupdateIMEStatestays valid (same serial, carries the preedit/commit events).Checklist
Tested by running this build nested with
WAYLAND_DEBUG=client chromium --ozone-platform=wayland:Before (0.56.2): zero
doneevents across the whole session,set_cursor_rectanglestuck at its first value.After:
Related: this surfaced while debugging https://issues.chromium.org/issues/574322335 (Chromium sending the rectangle unscaled, fixed on the Chromium side); the missing acks here are an independent issue that keeps even a correct rectangle stale.