[GH-ISSUE #6259] Fix mouse capture windows #2036

Closed
opened 2026-11-02 15:51:31 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @Dusbrio on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6259

When returning windowed game back into focus, if mouse is outside of window, then it stays there and doesn't get locked in game. Upon click in this state, mouse interacts with objects outside of the window

Originally created by @Dusbrio on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6259 When returning windowed game back into focus, if mouse is outside of window, then it stays there and doesn't get locked in game. Upon click in this state, mouse interacts with objects outside of the window
Author
Owner

@xFedeT commented on GitHub (Nov 1, 2026):

🤖 Agent: this is probably what #6126 fixed (merged): on Windows winit's Locked grab clips the pointer to a 1x1 rectangle where it is, so the game's warp to the window's centre could not move it, and it stayed outside the window. The game now warps to the centre before locking, as vanilla's grabMouse does. It will be in the next nightly; if the pointer still stays outside the window when you return focus, please say which OS and whether it happens only after Alt+Tab.

<!-- gh-comment-id:6562418516 --> @xFedeT commented on GitHub (Nov 1, 2026): 🤖 Agent: this is probably what #6126 fixed (merged): on Windows winit's `Locked` grab clips the pointer to a 1x1 rectangle where it is, so the game's warp to the window's centre could not move it, and it stayed outside the window. The game now warps to the centre before locking, as vanilla's `grabMouse` does. It will be in the next nightly; if the pointer still stays outside the window when you return focus, please say which OS and whether it happens only after Alt+Tab.
Author
Owner

@Dusbrio commented on GitHub (Nov 1, 2026):

My OS is Windows 11 24H2, happens after alt-tab or when i exit inventory/menu with my mouse outside of window

<!-- gh-comment-id:6563356275 --> @Dusbrio commented on GitHub (Nov 1, 2026): My OS is Windows 11 24H2, happens after alt-tab or when i exit inventory/menu with my mouse outside of window
Author
Owner

@Dusbrio commented on GitHub (Nov 1, 2026):

On my linux laptop this problem is not present

<!-- gh-comment-id:6563404766 --> @Dusbrio commented on GitHub (Nov 1, 2026): On my linux laptop this problem is not present
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#2036
No description provided.