src/video/windows/SDL_windowsevents.c
changeset 7089 257fc4e541e1
parent 7060 9d96148c2e3e
child 7191 75360622e65f
     1.1 --- a/src/video/windows/SDL_windowsevents.c	Mon Apr 22 18:14:32 2013 -0700
     1.2 +++ b/src/video/windows/SDL_windowsevents.c	Mon Apr 22 18:14:55 2013 -0700
     1.3 @@ -445,10 +445,16 @@
     1.4          }
     1.5  
     1.6  #ifdef WM_MOUSELEAVE
     1.7 -    /* FIXME: Do we need the SDL 1.2 hack to generate WM_MOUSELEAVE now? */
     1.8      case WM_MOUSELEAVE:
     1.9          if (SDL_GetMouseFocus() == data->window) {
    1.10 -            SDL_SetMouseFocus(NULL);
    1.11 +			if (!SDL_GetMouse()->relative_mode) {
    1.12 +				POINT cursorPos;
    1.13 +				GetCursorPos(&cursorPos);
    1.14 +				ScreenToClient(hwnd, &cursorPos);
    1.15 +				SDL_SendMouseMotion(data->window, 0, 0, cursorPos.x, cursorPos.y);
    1.16 +			}
    1.17 +
    1.18 +			SDL_SetMouseFocus(NULL);
    1.19          }
    1.20          returnCode = 0;
    1.21          break;