mirror of
https://github.com/encounter/SDL.git
synced 2025-12-08 13:15:10 +00:00
Relative mouse mode is tied to the window with keyboard focus
This isn't obvious, but makes sense when thinking about how games actually use it. This is also in line with how Windows mouse relative mode is implemented. Fixes https://github.com/libsdl-org/SDL/issues/5340
This commit is contained in:
@@ -262,9 +262,9 @@ Cocoa_SetRelativeMouseMode(SDL_bool enabled)
|
||||
/* We will re-apply the relative mode when the window gets focus, if it
|
||||
* doesn't have focus right now.
|
||||
*/
|
||||
SDL_Window *window = SDL_GetMouseFocus();
|
||||
SDL_Window *window = SDL_GetKeyboardFocus();
|
||||
if (!window) {
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* We will re-apply the relative mode when the window finishes being moved,
|
||||
|
||||
Reference in New Issue
Block a user