-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Implement proper grabbing behavior on macOS #1093
Copy link
Copy link
Open
Labels
D - averageLikely as difficult as most tasks hereLikely as difficult as most tasks hereDS - appkitAffects the AppKit/macOS backendAffects the AppKit/macOS backendH - good first issueIdeal for new contributorsIdeal for new contributorsP - normalGreat to haveGreat to haveS - platform parityUnintended platform differencesUnintended platform differences
Description
Right now on macOS, the cursor just gets locked to its current location, instead of getting locked to the area of the window. A proper solution that locks the cursor to the window exists and is documented, but hasn't been implemented yet.
See this comment:
winit/src/platform_impl/macos/window.rs
Lines 519 to 523 in 2442305
| pub fn set_cursor_grab(&self, grab: bool) -> Result<(), ExternalError> { | |
| // TODO: Do this for real https://stackoverflow.com/a/40922095/5435443 | |
| CGDisplay::associate_mouse_and_mouse_cursor_position(!grab) | |
| .map_err(|status| ExternalError::Os(os_error!(OsError::CGError(status)))) | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
D - averageLikely as difficult as most tasks hereLikely as difficult as most tasks hereDS - appkitAffects the AppKit/macOS backendAffects the AppKit/macOS backendH - good first issueIdeal for new contributorsIdeal for new contributorsP - normalGreat to haveGreat to haveS - platform parityUnintended platform differencesUnintended platform differences