feat(wayland): close the live-input gap with a sovereign virtual-input injector - #3
Merged
Merged
Conversation
…t injector The Wayland live screenshot proof passed but live INPUT was left "pending-on-compositor": the headless sway seat exposed no keyboard, so an injected key never reached the client. This closes it end to end. - internal/wayland: add sovereign client bindings for zwp_virtual_keyboard_v1 (create/keymap/key/modifiers) and zwlr_virtual_pointer_v1 (create/motion_absolute/button/frame) plus their manager globals. Attaching a virtual device to a seat makes that seat advertise the matching capability, so a plain client receives the injected events through the ordinary wl_keyboard / wl_pointer path. 100%-covered. - wl_seat: add an OnCapabilities callback; the window now binds pointer / keyboard dynamically when a device appears after bring-up (hot-plug), instead of a one-shot read at connect time — required for a device-less headless seat that only gains a keyboard once a virtual device attaches. - live test: over a SECOND connection the test is its own sovereign input source (no wtype/ydotool). It uploads a real libxkbcommon-compiled us keymap through the virtual keyboard, injects KEY_A and a left click, and asserts the exact dispatched toolkit.Event (char 'a', click coordinate) — nothing faked. Verified live under sway headless: EventChar 'a' and EventClick at (200,150). - wldynamic_test: deterministic in-process proof of the hot-plug path. - ci: upgrade the lane to "live Wayland (input)"; install libxkbcommon-tools for xkbcli, drop wtype. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task 1 — close the Wayland live-input gap
The Wayland live screenshot proof already passed, but live input was left
pending-on-compositor: the headlessswayseat exposed no keyboard, so aninjected key never reached the client. This closes it end to end, with the
behaviour captured (not claimed).
What changed
internal/wayland/virtual.go): clientside of
zwp_virtual_keyboard_manager_v1/zwp_virtual_keyboard_v1andzwlr_virtual_pointer_manager_v1/zwlr_virtual_pointer_v1. Attaching avirtual device to a seat makes it advertise the matching capability, so a
plain client receives the injected events through the ordinary
wl_keyboard/wl_pointerpath. 100 %-covered (both endian paths).wl_seatgains anOnCapabilitiescallback; thewindow binds pointer/keyboard when a device appears after bring-up, not
just at connect time — required for a device-less headless seat.
wtype/ydotool):uploads a real libxkbcommon-compiled
uskeymap through the virtualkeyboard, injects
KEY_A+ a left click, asserts the exact dispatchedtoolkit.Event.wldynamic_test.goproves the hot-plug pathin-process; the original fake-compositor input test stays.
live Wayland (input); installslibxkbcommon-tools(xkbcli), drops
wtype.Proof (captured, verified live under sway headless)
internal/x11andinternal/waylandboth at 100.0 % coverage under-race.🤖 Generated with Claude Code