Skip to content

input_method: don't fake the text input serial on stale commits - #2215

Open
GuitaristRin wants to merge 1 commit into
Smithay:masterfrom
GuitaristRin:input-method-commit-serial
Open

GuitaristRin wants to merge 1 commit into
Smithay:masterfrom
GuitaristRin:input-method-commit-serial

Conversation

@GuitaristRin

Copy link
Copy Markdown

Description

Problem

  • I discovered a stale commit problem when developing my Wayland compositor which stuck my keyboard input. When my compositor typed quickly that may cause not sync, the old code sent done(0) on a stale commit (done(true) → discard_state), which is the bug; the client applied the text but skipped sending the new state (surrounding text / cursor rectangle) back to the input method.

Protocol

  • input-method-unstable-v2: Stale commit should be handled as ordinary.
  • text-input-unstable-v3: The text input serial is the text input's own commit counter, unrelated to the input method's serial.

Fix

  • I changed it to always send the text input's own serial (done(false)).

Testing

  • I tested on my own Compositor called Ether, it is still a private one. Also I tested on Qt/GTK apps, works good.

AI Disclosure

  • Developed with AI assistance (Claude Code); reviewed and understood by me.

Related

  • None

Checklist

When an input method commits with a serial that differs from the number
of done events it received, input-method-unstable-v2 says the compositor
must proceed as normal. Smithay instead sent done(0) to the text input.

The text input serial counts the commits of the text input itself, so it
is unrelated to the input method serial. With the fake 0, clients that
follow text-input-unstable-v3 (GTK, Qt) still apply the text but skip
sending their new state (surrounding text, cursor rectangle) back to the
input method.

Always send the text input's own serial.

Developed with AI assistance (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant