Skip to content

fix(ime): implement set_preedit_region and fix done_serial tracking for Korean IME - #29

Closed
kkimdev wants to merge 3 commits into
google:virtwlfrom
kkimdev:wayland-ime-core-2-1
Closed

fix(ime): implement set_preedit_region and fix done_serial tracking for Korean IME#29
kkimdev wants to merge 3 commits into
google:virtwlfrom
kkimdev:wayland-ime-core-2-1

Conversation

@kkimdev

@kkimdev kkimdev commented Jul 8, 2026

Copy link
Copy Markdown

This is PR 2-1 of a stacked series (split from #27 for reviewability). PR 1 (#28) was a behavior-neutral refactor.


Last syllable lost when committing Korean text via Space/Enter

Composing "가나다" and pressing Space or Enter drops the final syllable "다".

Cause: Two bugs:

  1. set_preedit_region was a no-op. ChromeOS IME calls this on every keystroke to describe where the composition starts relative to cursor. Without it the cursor offset is wrong when committing.
  2. done serial was hardcoded to 0. Guests validate serials — they discard updates where the serial has not advanced.

Fix:

  1. Translate set_preedit_region into v3 delete_surrounding_text + preedit_string + done.
  2. Add with_state helper that manages a monotonically increasing done_serial; wire to all done-sending paths.

Known limitation: When the IME commit is followed by an Enter key event, the fix is incomplete. This requires the serial/activation changes from the next PR in the stack.


 sommelier/src/handler/text_input.rs | 296 +++++++++++++++++++----
 sommelier/src/state.rs              |   2 +
 2 files changed, 259 insertions(+), 39 deletions(-)

@kkimdev
kkimdev force-pushed the wayland-ime-core-2-1 branch from 58a3159 to 873c66b Compare July 8, 2026 23:18
@kkimdev kkimdev changed the title fix(ime): implement set_preedit_region, confirm_preedit, and done_serial tracking fix(ime): implement set_preedit_region handler for Korean IME composition Jul 8, 2026
@kkimdev
kkimdev force-pushed the wayland-ime-core-2-1 branch from 873c66b to 81f201d Compare July 8, 2026 23:26
@kkimdev kkimdev changed the title fix(ime): implement set_preedit_region handler for Korean IME composition fix(ime): implement set_preedit_region and fix done_serial tracking for Korean IME Jul 8, 2026
@kkimdev kkimdev changed the title fix(ime): implement set_preedit_region and fix done_serial tracking for Korean IME fix(ime): implement set_preedit_region, fix done_serial tracking, and forward real serial in on_keysym Jul 8, 2026
@kkimdev kkimdev changed the title fix(ime): implement set_preedit_region, fix done_serial tracking, and forward real serial in on_keysym fix(ime): implement set_preedit_region and fix done_serial tracking for Korean IME Jul 8, 2026
@kkimdev

kkimdev commented Jul 8, 2026

Copy link
Copy Markdown
Author

Replaced by full core-2 PR

@kkimdev kkimdev closed this Jul 8, 2026
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