From 6f6c76a6a5252cc8d2b7820ed17626976255e675 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 27 Dec 2013 10:18:18 -0800 Subject: [PATCH] Make sure our window has mouse focus before processing raw input events. This happens rarely, but not reproducibly, where we get raw input events for the window even though it doesn't have focus. --- src/video/windows/SDL_windowsevents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index 103a9bff1..aaebc0ac1 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -417,7 +417,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) RAWINPUT inp; UINT size = sizeof(inp); - if (!mouse->relative_mode || mouse->relative_mode_warp) { + if (!mouse->relative_mode || mouse->relative_mode_warp || mouse->focus != data->window) { break; }