Repository navigation
Conversation
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.
On macOS 26, after switching away from a native fullscreen Space and back,
clicking near the top of the window can deliver a bogus motion event between
otherwise correct press/release positions. This makes click handlers interpret
a stationary click as a drag and cancel it.
A captured downstream sequence on macOS 26.7.1 was:
(142.6, 27.1)(-668.4, -1052.9), sometimes followed by an exit(142.6, 27.1)For motion/drag callbacks in native fullscreen windows on macOS 26+, query the
live pointer position through
NSWindowand convert it to the receivingNSView. Button, wheel and other gesture callbacks retain their event-timecoordinates. During a held gesture, suppress an exit only while the live pointer
is actually inside the view; genuine outside movement and releases remain valid.
Windowed mode and older macOS versions retain the existing path.
This follows the scoped workaround described in
SDL's implementation.
Using Cocoa's window/view conversion avoids manually subtracting display origins.
There is a tradeoff: affected motion uses the position at dispatch time rather
than the historical event position.
Validation:
cargo test -p winit-appkit --lib: 8 passed on macOS 26.7.1.cargo clippy -p winit-appkit --all-targets -- -D warnings: passed.confirmed that repeated header clicks work after restarting with the fix.
stationary clicks, genuine outside drags and moving out and back before release.
run of this master-branch port. Multiple-display/scale combinations and other
macOS versions have not been exhaustively tested.
code, with unrelated formatting changes removed; nightly formatting may need
to be applied by CI/maintainers.
Checklist: