fix(cua-driver): preserve X11 keyboard delivery and timing - #3761
Merged
Conversation
(cherry picked from commit df3b3b6)
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
Land the Linux X11 keyboard timing and completion fix from #3709 on current
mainwhile preserving Peter Steinberger as the commit author and recording the original commit withcherry-pick -x.X11 keyboard taps previously buffered key-down across the intended delay, allowing key-down and key-up to reach the server together. Background key and typing paths could also close their short-lived connection before final events were processed. This change flushes key-down before the existing delay and completes background delivery with a reply-bearing X11 request.
Related work
Fixes #3708.
Supersedes #3709 because its branch conflicts with the release-generated changelog on current
main. Salvaged from #3709 with the original commit author and source commit preserved.No RFC is required: this repairs the existing Linux input contract without changing a public SDK, CLI, MCP, protocol, permission, or cross-platform behavior contract.
Validation
Exact landing candidate:
de6654fdc05467d2c85c46a941d281812bfe24df.cargo fmt --all -- --checkgit diff --check origin/main...HEADcargo test -p platform-linux --lib --locked(23 passed)macos-electron-type-text-ax-backgroundcell failed again on candidate retry, then failed identically on the pre-change base141a6daa6e16cf8986e04f0f1c9a361d37175ce6(delivered 0 of 17 character(s) via CGEvent), proving the macOS failure predates and is unrelated to this Linux-only diffA short merged-
mainsmoke and Cua Driver release-path verification will follow the merge.Compatibility and risk
The production diff is confined to Linux X11 input. macOS, Windows, and native Wayland adapters are unchanged. The fix preserves existing modifier ordering, routing, focus, and timing values. It does not add a held-key API or claim that a 10 ms tap is sufficient for every state-polled game.