dnkl/foot
41
2.0k
Fork
You've already forked foot
243

ime: apply text-input done updates on serial mismatch #2281

Closed
stalkerg wants to merge 1 commit from stalkerg/foot:fix/ime-done-serial-mismatch into master
pull from: stalkerg/foot:fix/ime-done-serial-mismatch
merge into: dnkl:master
dnkl:master
dnkl:osc-5522
dnkl:sixel-heap-buffer-overflow
dnkl:releases/1.27
dnkl:releases/1.26
dnkl:releases/1.25
dnkl:releases/1.24
dnkl:multi-cursor
dnkl:releases/1.23
dnkl:pixman-16f-2
dnkl:releases/1.22
dnkl:releases/1.21
dnkl:releases/1.20
dnkl:releases/1.19
dnkl:releases/1.18
dnkl:releases/1.17
dnkl:releases/1.16
dnkl:releases/1.15
dnkl:releases/1.14
dnkl:releases/1.13
dnkl:releases/1.12
dnkl:releases/1.11
dnkl:releases/1.10
dnkl:releases/1.9
dnkl:releases/1.8
dnkl:releases/1.7
dnkl:releases/1.6
dnkl:releases/1.5
dnkl:releases/1.4
dnkl:releases/1.3
dnkl:releases/1.2
dnkl:releases/1.1
dnkl:releases/1.0
First-time contributor
Copy link

Summary

This PR fixes an IME input failure where foot can stop applying IME text after zwp_text_input_v3.done arrives with a serial different from seat->ime.serial.

In the current code, a serial mismatch causes an early return in ime.c::done(), so pending IME updates (commit_string / preedit_string) are dropped for that
done batch.

What changed

In ime.c, done() no longer returns early on serial mismatch.

Instead, foot still logs the mismatch, but continues applying the IME payload from that event as usual.

Why this is the right behavior

text-input-v3 explicitly allows this case and still requires applying incoming text updates.
The protocol says clients must:

"it must proceed with evaluating and applying the changes as normal"

So dropping IME payload only because serials differ is too strict and can break real-world compositor/IME timing.

Scope

This is intentionally a minimal fix:

  • no behavior changes outside done() mismatch handling
  • existing logging remains
  • build passes after the change

Protocol reference: https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/text-input/text-input-unstable-v3.xml

## Summary This PR fixes an IME input failure where foot can stop applying IME text after `zwp_text_input_v3.done` arrives with a serial different from `seat->ime.serial`. In the current code, a serial mismatch causes an early return in `ime.c::done()`, so pending IME updates (`commit_string` / `preedit_string`) are dropped for that `done` batch. ## What changed In `ime.c`, `done()` no longer returns early on serial mismatch. Instead, foot still logs the mismatch, but continues applying the IME payload from that event as usual. ## Why this is the right behavior `text-input-v3` explicitly allows this case and still requires applying incoming text updates. The protocol says clients must: > "it must proceed with evaluating and applying the changes as normal" So dropping IME payload only because serials differ is too strict and can break real-world compositor/IME timing. ## Scope This is intentionally a minimal fix: - no behavior changes outside `done()` mismatch handling - existing logging remains - build passes after the change Protocol reference: https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/text-input/text-input-unstable-v3.xml
ime: apply text-input done updates on serial mismatch
All checks were successful
builds.sr.ht/freebsd-x64 Job completed
0ca0b10a0f
Author
First-time contributor
Copy link

After all, I don't think it's a real issue.

After all, I don't think it's a real issue.
stalkerg closed this pull request 2026年02月18日 09:08:12 +01:00
All checks were successful
builds.sr.ht/freebsd-x64 Job completed

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dnkl/foot!2281
Reference in a new issue
dnkl/foot
No description provided.
Delete branch "stalkerg/foot:fix/ime-done-serial-mismatch"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?