Skip to content

Commit

Permalink
Relative mouse mode is tied to the window with keyboard focus
Browse files Browse the repository at this point in the history
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 #5340
  • Loading branch information
slouken committed Mar 19, 2022
1 parent b559a4a commit 0517b61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/video/cocoa/SDL_cocoamouse.m
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ + (NSCursor *)invisibleCursor
/* 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,
Expand Down

0 comments on commit 0517b61

Please sign in to comment.