Don't warp the mouse for relative mode when the window doesn't have focus

This commit is contained in:
Sam Lantinga committed 2021-08-13 11:39:41 -07:00
1 parent 629e9f820a
commit b28ed02803
2 files changed
+5 -2

No files matched your search

+3 -1
View File
@@ -358,7 +358,9 @@ SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relativ
mouse->last_y = center_y;
return 0;
}
SDL_WarpMouseInWindow(window, center_x, center_y);
if (window && (window->flags & SDL_WINDOW_INPUT_FOCUS) != 0) {
SDL_WarpMouseInWindow(window, center_x, center_y);
}
}
if (relative) {