[GH-ISSUE #1224] macOS: the pointer isn't locked in first person #311

Closed
opened 2026-11-02 15:38:06 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @pirut on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1224

On macOS (launcher build v2026.10.19.15), the pointer is not locked to the window while playing in first person: it moves freely across the screen and can leave the window.

Cause: Game::capture grabs the pointer with CursorGrabMode::Locked, then warps it to the window centre with set_cursor_position. On macOS, winit 0.30's set_cursor_position ends with CGAssociateMouseAndMouseCursorPosition(true), which undoes the lock the grab just set.

Originally created by @pirut on GitHub (Oct 22, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1224 On macOS (launcher build v2026.10.19.15), the pointer is not locked to the window while playing in first person: it moves freely across the screen and can leave the window. Cause: `Game::capture` grabs the pointer with `CursorGrabMode::Locked`, then warps it to the window centre with `set_cursor_position`. On macOS, winit 0.30's `set_cursor_position` ends with `CGAssociateMouseAndMouseCursorPosition(true)`, which undoes the lock the grab just set.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#311
No description provided.