mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-12 21:01:00 +00:00
sdl2: fix mouse grabbing in windowed
Should now ignore all motion events and not warp the mouse when the window is out of focus.
This commit is contained in:
parent
1bfea632c9
commit
3a1a0c8871
1 changed files with 5 additions and 2 deletions
|
@ -853,9 +853,12 @@ static void Impl_HandleMouseMotionEvent(SDL_MouseMotionEvent evt)
|
|||
}
|
||||
|
||||
event.type = ev_mouse;
|
||||
D_PostEvent(&event);
|
||||
|
||||
HalfWarpMouse(wwidth, wheight);
|
||||
if (SDL_GetMouseFocus() == window && SDL_GetKeyboardFocus() == window)
|
||||
{
|
||||
D_PostEvent(&event);
|
||||
HalfWarpMouse(wwidth, wheight);
|
||||
}
|
||||
}
|
||||
|
||||
static void Impl_HandleMouseButtonEvent(SDL_MouseButtonEvent evt, Uint32 type)
|
||||
|
|
Loading…
Reference in a new issue