Repository navigation
Cross-window drops resolve by the drag's source window - #19
Merged
Merged
Conversation
MouseInput::Released trusted whichever window the OS delivered the release to as a live drag's owner, even though the drag's true source is recorded separately. On Wayland, winit has no implicit pointer grab, so a cross-window carry's release can land on the target window instead of the source that tore the surface off. Resolving the drop against the wrong WindowState skipped the source's carried-exclusion cleanup, leaving it hidden with its OS window never shown again. Route every release through the drag's recorded source window instead of the event's window, recomputing the drop hover fresh against whichever window actually received the release when the two differ. Add an invariant backstop that sweeps every window after any drag resolution (drop, cancel, or misrouted release) and force-clears a carried exclusion left armed, so a hidden window can never survive past the drag that hid it, independent of the routing fix itself. Covered by new unit tests for the pure routing decision and the backstop's clearing predicate. cargo test --workspace, clippy, and fmt are clean. Fixes #18 Co-Authored-By: Claude Fable 5 <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.
Fixes a cross-window drag bug reported on Ubuntu 24.04: dropping a wisp-carried surface onto another window could make the pane disappear, with its shell still running invisibly.
Fixes #18
Mechanism. The mouse-release handler resolved a drag against whichever window the OS delivered the release event to, assuming that is always the drag's source window. Wayland provides no implicit pointer grab during such a drag, so the release can be delivered to the window under the cursor - the drop target - instead. The drag then ended half-resolved, and the source window's hidden-while-carried bookkeeping could be left set, leaving the carried surface excluded from layout indefinitely.
Fix, two layers:
Testing. 8 new unit tests on the routing decision and the exclusion-clearing predicate; full workspace suite green; the X11 headless two-window reproduction (sole-tab window carried onto a single-pane window) re-run and passing: source window closes, target gains the tab, both shell sessions preserved. The Wayland misdelivery itself cannot be synthesized headlessly - verification there is by the traced mechanism plus the backstop invariant; field confirmation on the issue is welcome.
🤖 Generated with Claude Code