Make sure our window has mouse focus before processing raw input events.
authorSam Lantinga <slouken@libsdl.org>
Fri, 27 Dec 2013 10:18:18 -0800
changeset 8084 96b1986b1e61
parent 8083 3782a12331d6
child 8085 051c0c4cf161
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
--- a/src/video/windows/SDL_windowsevents.c	Fri Dec 27 10:18:11 2013 -0800
+++ b/src/video/windows/SDL_windowsevents.c	Fri Dec 27 10:18:18 2013 -0800
@@ -417,7 +417,7 @@
             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;
             }