Repository navigation
Wayland: IME keeps working after a seat loses a capability (winit#4747) - #672
Merged
echelon merged 2 commits intoOct 10, 2026
Merged
Conversation
winit 0.30.13 destroys a seat's zwp_text_input_v3 in SeatHandler::remove_capability, whichever capability went away (a touch screen or tablet unplugged, a remote-desktop session ending), and only new_capability recreates it. A seat that loses a capability without gaining one leaves PdfCraft without a text input: IME (fcitx5, IBus) stops working until PdfCraft is restarted. The text input belongs to the seat, so vendor/winit now destroys it in remove_seat only, as rust-windowing/winit#4747 does on winit master. A test fails if a re-vendored winit loses the patch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 10, 2026
Member
|
Merged, thank you! Destroying a seat's text input in If you haven't already, come join us on Discord: https://discord.gg/artcraft |
This was referenced Oct 10, 2026
krichelj
pushed a commit
to krichelj/pdfcraft
that referenced
this pull request
Oct 11, 2026
…7) (storytold#672) winit 0.30.13 destroys a seat's zwp_text_input_v3 in SeatHandler::remove_capability, whichever capability went away (a touch screen or tablet unplugged, a remote-desktop session ending), and only new_capability recreates it. A seat that loses a capability without gaining one leaves PdfCraft without a text input: IME (fcitx5, IBus) stops working until PdfCraft is restarted. The text input belongs to the seat, so vendor/winit now destroys it in remove_seat only, as rust-windowing/winit#4747 does on winit master. A test fails if a re-vendored winit loses the patch. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Brandon Thomas <echelon@gmail.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.
Summary
On Wayland, IME (fcitx5, IBus) stops working in a running PdfCraft after the seat loses any capability, for example when a touch screen or tablet is unplugged or a remote-desktop session (Sunshine) ends, and stays broken until PdfCraft is restarted. This keeps the seat's text input until the seat itself goes away.
Port of rust-windowing/winit#4747 (reviewed head
2060ab0f88) to the vendored winit 0.30.13. It is the same change, applied to 0.30's file layout.PdfCraft impact
Every egui
TextEdit(Search, form fields, the JavaScript console, comments, stamp and signature fields, the command palette) gets IME input on Wayland through winit'szwp_text_input_v3.Root cause
vendor/winit/src/platform_impl/linux/wayland/seat/mod.rs:SeatHandler::remove_capabilitydestroyedseat_state.text_inputwhichever capability was removed. The text input comes fromzwp_text_input_manager_v3, not from a capability, andnew_capabilityonly recreates it when a capability is added. A seat that just loses one is left without a text input for the rest of the session.remove_seatdropped the seat state without destroying its text input.Change
remove_capabilityno longer touches the text input.remove_seatdestroys it with the seat.Nothing else in seat handling changes (the tablet handling next to it is left as it was, as upstream does).
Not included
Nothing else from winit master.
Verification
WAYLAND_DEBUG=1: the unpatched client sendszwp_text_input_v3.destroyon a touch capability removal and never recreates it; the patched one only releaseswl_touch) and end to end with fcitx5.Ime::Preedit/Ime::Commitmust keep arriving.apps/pdfcraft/tests/winit_wayland_text_input.rsfails if a re-vendored winit destroys the text input inremove_capabilityagain, or stops destroying it inremove_seat.Automated checks
aarch64-apple-darwin,x86_64-pc-windows-msvcandx86_64-unknown-linux-musl(cargo clippy --lib, lints capped to warnings): the warnings are the same as onmainfor all three (the one existingclippy::iter_kv_mapinlinux/x11/event_processor.rs).cargo check --locked -p winitinside the PdfCraft workspace, with PdfCraft's ownCargo.lock, on macOS and on the tree with all nine fixes merged: clean.main(fails);rustfmt --checkandclippy -D warningson it are clean.cargo test --workspaceand workspace clippy (the machine is short of disk space for a full build). CI runs them on Linux and Windows.Risk
The text input now outlives capability changes, as the protocol intends. Removing the keyboard capability already sends
on_keyboard_destroy, which drops the window's focus, so the compositor's text input leave and enter keep following focus.Revert and removal
This change is independent of the other winit PRs and can be reverted on its own. Drop it, together with the test and README item (2), once PdfCraft uses a winit release that includes rust-windowing/winit#4747 or an equivalent fix.
Merging alongside the other winit PRs
This is one of nine fixes to
vendor/winitsent together: #672 (Wayland IME after a capability change), #673 (Windows Korean IME caret), #674 (Windows maximized start-up), #675 (X11 input context focus), #676 (macOS IME commit state), #677 (macOS stale composition), and, building on #676, #678 (macOS emoji picker), #679 (macOS Korean double space), #680 (macOS first Korean key). Each adds one numbered item to the single winit row invendor/README.md, so they conflict with each other on that one line, and nowhere else (each test is in its own file). The item numbers (2)–(10) are fixed in advance: to resolve, keep every item in numeric order. All nine were merged locally in one tree (only that line conflicted); the combined vendored winit builds for macOS, Windows and Linux with the same clippy output asmain, and all nine tests pass on it.🤖 Generated with Claude Code