You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a bidirectional Linux/Wayland ↔ macOS setup, Lan Mouse's macOS event tap
observes the pointer events posted by its own emulation backend. A synthesized
edge event can therefore be mistaken for a new local capture and immediately
send the pointer back, producing an Arch → macOS → Arch capture loop.
Changes
tag every macOS event posted by the emulation backend and retain a process-ID
fallback when CoreGraphics does not preserve the tag
keep separate physical and emulated edge-arm state
ignore the initial outward crossing, then re-arm on the first inward motion
so short reversals work
send a synthesized return crossing only to the matching EnterOnly capture
while preserving normal default capture for chained topologies
handle dragged-pointer crossings as motion
make capture state updates synchronous and release the state lock before
bounded event delivery
add routing, short-reversal, drag, and stream-progress regression tests
Tested this on Arch + niri with macOS as the client. Before this PR, I could move the mouse from Linux to macOS, but fairly often it would get stuck there and I’d have to use the release bind to get back.
With this branch, I’ve been rapidly moving back and forth between Linux and macOS and haven’t been able to reproduce the issue at all so far.
Looks like this fixes it for me. Happy to test anything else if useful.
Tested this on Arch + niri with macOS as the client. Before this PR, I could move the mouse from Linux to macOS, but fairly often it would get stuck there and I’d have to use the release bind to get back.
With this branch, I’ve been rapidly moving back and forth between Linux and macOS and haven’t been able to reproduce the issue at all so far.
Looks like this fixes it for me. Happy to test anything else if useful.
Thats nice to hear!
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
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.
Problem
On a bidirectional Linux/Wayland ↔ macOS setup, Lan Mouse's macOS event tap
observes the pointer events posted by its own emulation backend. A synthesized
edge event can therefore be mistaken for a new local capture and immediately
send the pointer back, producing an Arch → macOS → Arch capture loop.
Changes
fallback when CoreGraphics does not preserve the tag
so short reversals work
EnterOnlycapturewhile preserving normal default capture for chained topologies
bounded event delivery
Validation
cargo fmt --all -- --checkcargo test --workspace --all-features --lockedcargo clippy -p input-capture --all-targets --all-features --locked -- -D warnings3d202975@rpathdependency closure andcodesign --verify --deep --strictpass locally
Physical Arch → macOS → Arch verification is still running against the Arch
binary from #471 (
83e66bc), so this is a draft.Scope
CoreGraphics event provenance is left for a follow-up
This is independent of #471, which contains the input post-processing changes.