Fixed mouse focus window reporting
authorSam Lantinga <slouken@libsdl.org>
Thu, 17 Jun 2010 12:33:05 -0700
changeset 4470 a5878b271b74
parent 4469 f67139f6d87f
child 4471 11cedc036ca1
Fixed mouse focus window reporting FIXME: Should the window be a parameter to the mouse events again?
src/video/win32/SDL_win32events.c
--- a/src/video/win32/SDL_win32events.c	Sun Jun 06 21:09:45 2010 -0700
+++ b/src/video/win32/SDL_win32events.c	Thu Jun 17 12:33:05 2010 -0700
@@ -176,23 +176,24 @@
         returnCode = 0;
         break;
 
-    case WM_MOUSEMOVE:
+	case WM_MOUSEMOVE:
+        SDL_SetMouseFocus(data->window);
         SDL_SendMouseMotion(0, LOWORD(lParam), HIWORD(lParam));
         break;
 
     case WM_LBUTTONDOWN:
+        SDL_SetMouseFocus(data->window);
         SDL_SendMouseButton(SDL_PRESSED, SDL_BUTTON_LEFT);
         break;
 
     case WM_LBUTTONUP:
+        SDL_SetMouseFocus(data->window);
         SDL_SendMouseButton(SDL_RELEASED, SDL_BUTTON_LEFT);
         break;
 
     case WM_MOUSELEAVE:
-        {
-            if (SDL_GetMouseFocus() == data->window) {
-                SDL_SetMouseFocus(NULL);
-            }
+        if (SDL_GetMouseFocus() == data->window) {
+            SDL_SetMouseFocus(NULL);
         }
         returnCode = 0;
         break;