src/video/windows/SDL_windowsevents.c
changeset 7275 0a6b3b998814
parent 7191 75360622e65f
child 7276 37814e7eeff3
equal deleted inserted replaced
7274:d9ef44d91559 7275:0a6b3b998814
   444             break;
   444             break;
   445         }
   445         }
   446 
   446 
   447 #ifdef WM_MOUSELEAVE
   447 #ifdef WM_MOUSELEAVE
   448     case WM_MOUSELEAVE:
   448     case WM_MOUSELEAVE:
   449         if (SDL_GetMouseFocus() == data->window) {
   449         if (SDL_GetMouseFocus() == data->window && !SDL_GetMouse()->relative_mode) {
   450             if (!SDL_GetMouse()->relative_mode) {
   450             POINT cursorPos;
   451                 POINT cursorPos;
   451             GetCursorPos(&cursorPos);
   452                 GetCursorPos(&cursorPos);
   452             ScreenToClient(hwnd, &cursorPos);
   453                 ScreenToClient(hwnd, &cursorPos);
   453             SDL_SendMouseMotion(data->window, 0, 0, cursorPos.x, cursorPos.y);
   454                 SDL_SendMouseMotion(data->window, 0, 0, cursorPos.x, cursorPos.y);
       
   455             }
       
   456 
       
   457             SDL_SetMouseFocus(NULL);
   454             SDL_SetMouseFocus(NULL);
   458         }
   455         }
   459         returnCode = 0;
   456         returnCode = 0;
   460         break;
   457         break;
   461 #endif /* WM_MOUSELEAVE */
   458 #endif /* WM_MOUSELEAVE */