Restrict mouse to window when in focus

This commit is contained in:
Ronald Kinard 2014-11-13 19:18:24 -06:00
parent d056e82b3b
commit 869c4241eb

View file

@ -752,6 +752,7 @@ static void Impl_HandleMouseMotionEvent(SDL_MouseMotionEvent evt)
if (SDL_GetMouseFocus() == window && SDL_GetKeyboardFocus() == window) if (SDL_GetMouseFocus() == window && SDL_GetKeyboardFocus() == window)
{ {
D_PostEvent(&event); D_PostEvent(&event);
SDL_SetWindowGrab(window, SDL_TRUE);
HalfWarpMouse(wwidth, wheight); HalfWarpMouse(wwidth, wheight);
} }
} }