Skip to content

feat(ime): implement on_confirm_preedit handler - #34

Open
kkimdev wants to merge 2 commits into
google:virtwlfrom
kkimdev:wayland-ime-core-2-6-confirm-preedit
Open

feat(ime): implement on_confirm_preedit handler#34
kkimdev wants to merge 2 commits into
google:virtwlfrom
kkimdev:wayland-ime-core-2-6-confirm-preedit

Conversation

@kkimdev

@kkimdev kkimdev commented Jul 10, 2026

Copy link
Copy Markdown

Split from #30 for easier review.

The on_confirm_preedit handler was a no-op — when the host IME confirmed a
preedit string, the guest was never notified and the preedit text was lost.

Fix

Cache the preedit text from on_preedit_string in TextInputState.current_preedit,
then on confirm_preedit flush it to the guest as a v3 commit_string:

  1. Send v3 preedit_string("") to clear the underline
  2. Send v3 commit_string with the cached text
  3. Send v3 done to apply

If current_preedit is empty, only done is sent (no-op confirmation).

Changes

  • on_confirm_preedit: commit cached preedit via v3 preedit_string + commit_string + done
  • New field: TextInputState.current_preedit: String
  • 3 tests: confirm with text, confirm empty, unknown host

@kkimdev
kkimdev marked this pull request as ready for review July 10, 2026 23:31
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