mirror of
https://github.com/encounter/SDL.git
synced 2025-06-10 00:23:41 +00:00
Don't center the mouse when gaining focus unless we're using relative mode warping
This is necessary now that we actually change the mouse position when calling SDL_WarpMouseInWindow() in relative mode.
This commit is contained in:
parent
a70a94e0b3
commit
1c5b3e0e16
@ -2897,8 +2897,10 @@ SDL_OnWindowFocusGained(SDL_Window * window)
|
|||||||
|
|
||||||
if (mouse && mouse->relative_mode) {
|
if (mouse && mouse->relative_mode) {
|
||||||
SDL_SetMouseFocus(window);
|
SDL_SetMouseFocus(window);
|
||||||
|
if (mouse->relative_mode_warp) {
|
||||||
SDL_WarpMouseInWindow(window, window->w/2, window->h/2);
|
SDL_WarpMouseInWindow(window, window->w/2, window->h/2);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SDL_UpdateWindowGrab(window);
|
SDL_UpdateWindowGrab(window);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user