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:
Ronald Kinard 2014-07-25 23:47:14 -05:00
parent 1bfea632c9
commit 3a1a0c8871
1 changed files with 5 additions and 2 deletions

View File

@ -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)