From 889788d6e97fcb9d859b0da569158880c41e478b Mon Sep 17 00:00:00 2001 From: "J?rgen P. Tjern?" Date: Wed, 5 Jun 2013 12:00:18 -0700 Subject: [PATCH] Win32: Fix issue with SetCapture & negative values. This fixes an issue where we were using the wrong macros to extract the position from WM_MOUSEMOVE, so negative values were behaving incorrectly. These would be generated in multimon situations, or if you use SetCapture. Fixes http://bugzilla.libsdl.org/show_bug.cgi?id=1175 --- src/video/windows/SDL_windowsevents.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index 4ceac554f..dcd183d6f 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -33,6 +33,8 @@ /* Dropfile support */ #include +/* For GET_X_LPARAM, GET_Y_LPARAM. */ +#include /*#define WMMSG_DEBUG*/ #ifdef WMMSG_DEBUG @@ -381,7 +383,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_MOUSEMOVE: if( !SDL_GetMouse()->relative_mode ) - SDL_SendMouseMotion(data->window, 0, 0, LOWORD(lParam), HIWORD(lParam)); + SDL_SendMouseMotion(data->window, 0, 0, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); /* don't break here, fall through to check the wParam like the button presses */ case WM_LBUTTONUP: case WM_RBUTTONUP: