streamline cursor clipping logic on windows #11237
Merged
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.
This commit does the following:
WM_MOUSEMOVE
case of the Window to conditionally callWIN_UpdateClipCursor
upon receiving cursor motion if SDL is expecting the mouse to be clipped in some way (Fixes Cursor not constrained to window when usingSDL_SetRelativeMouseMode
and another game is running #7890)SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL
hint (superceded by the above bullet point)WIN_UpdateClipCursor
for better readability of each branch, and avoid calling the Platform API until it is absolutely necessary.relative_mouse_center
field from Windows-specific per-windowSDL_WindowData
to the globalSDL_Mouse
struct, and the corresponding hint callbacks toSDL_mouse.c
instead ofSDL_windowswindow.c
relevant commits:
e56f05b (apr 2024)
6c96217 (mar 2024)
ab5351f (mar 2024)
50203d5 (dec 2020)
44f50c6 (jun 2020)
55b24b9 (sep 2018)