zwp_input_method_v2 over one connection, in one process: activate, deactivate and content type applied at done, whose count is the serial a commit must carry. The keyboard is grabbed at every activate and released at every deactivate, because sway hands keys to the grab holder without asking whether the input method is active, and a grab held while inactive would take every key in the session. Keys come as evdev codes, go through xkb and the Compose table the other frontends already share, and reach the engine as an ipckeysym and a modifier mask; the grab's modifiers go on to the virtual keyboard as well, since wlroots derives no state from a virtual keyboard's own keys. A key the engine does not eat goes back as a key, not as text, and whatever is still down is released when the context goes. A password or a PIN purpose never reaches the engine at all. No popup yet: the X11 one still owns drawc, and with no Keycaret from us it follows the pointer. Checked by hand under headless sway 1.12 with a GTK3 entry driven by wtype: ascii passes through, Ctrl+s selects Korean, rk shows the preedit and Enter commits 가 and lets the Return on, Ctrl+c arrives with its modifier, focus moving between two clients re-grabs and keeps typing, a password entry types literally, a second strans says so and stops, and WAYLAND_DISPLAY without a compositor falls back to XIM. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1.4 KiB
1.4 KiB