Skip to content

Fix zero serial/time in IME-forwarded wl_keyboard::key events - #1

Closed
kkimdev wants to merge 2 commits into
virtwlfrom
wayland-ime-core-2-2-keysym-serial
Closed

Fix zero serial/time in IME-forwarded wl_keyboard::key events#1
kkimdev wants to merge 2 commits into
virtwlfrom
wayland-ime-core-2-2-keysym-serial

Conversation

@kkimdev

@kkimdev kkimdev commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Split from google#30 for easier review.

wl_keyboard::key events forwarded from the IME's on_keysym handler used
serial=0 and time=0, which can cause the guest compositor to reject or
misorder them.

Fix

  • Pass the real serial and time from on_keysym instead of hardcoded 0.
  • Add store_host_serial helper and host_serial field to capture the IME
    serial for later use by commit_state (PR 7).

Changes

  • on_keysym: forward serial, time to wl_keyboard::key (opcode 3)
  • New: store_host_serial(ctx, host_id, serial)
  • New: TextInputState.host_serial (initialised to 0)
  • 3 tests

kkimdev added 2 commits July 8, 2026 13:38
…sh_msg and add tracing (google#28)

Replace the open-coded extend_from_slice + (len << 16) | opcode wire assembly
with the existing MessageBuilder::build_message helper wrapped in a push_msg
helper. MessageBuilder produces byte-identical wire output, so this is a
behavior-neutral refactor. Add structured log::trace/debug/info instrumentation
to every IME handler to make the host<->guest event flow observable.

This lays the groundwork (shared helpers + logging) for the follow-up IME
correctness fixes without changing any protocol behavior.
@kkimdev kkimdev closed this Jul 10, 2026
@kkimdev
kkimdev deleted the wayland-ime-core-2-2-keysym-serial branch July 10, 2026 14:48
@kkimdev
kkimdev restored the wayland-ime-core-2-2-keysym-serial branch July 10, 2026 14:48
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