Merge pull request #1225 from pirut/claude/upstream-macos-pointer-lock

🤖 Agent: merged after verify passed and the integration run on the desktop (main 34c3c1cf + the 14 contributor PRs: workspace tests 1,869/0, launcher 113, parity --changed 320/0).
This commit is contained in:
Ludovic Marie
2026-10-22 19:54:10 +02:00
committed by GitHub
+7
View File
@@ -4487,10 +4487,17 @@ impl Game<'_> {
};
if capture {
self.mouse.set_ignore_first_move();
// macOS warps by re-associating the mouse with the pointer,
// which undoes a Locked grab and leaves the pointer free: warp
// first there. Wayland moves a pointer only while it is locked,
// so everywhere else warp after grabbing.
#[cfg(target_os = "macos")]
warp(window);
self.captured = window
.set_cursor_grab(CursorGrabMode::Locked)
.or_else(|_| window.set_cursor_grab(CursorGrabMode::Confined))
.is_ok();
#[cfg(not(target_os = "macos"))]
if self.captured && self.focused {
warp(window);
}