Don't warp the mouse while we're doing a modal interaction
authorSam Lantinga <slouken@libsdl.org>
Mon, 24 Feb 2014 23:09:35 -0800
changeset 8254 f97b5166c158
parent 8253 75ad8ebb3768
child 8255 49af9be342cd
Don't warp the mouse while we're doing a modal interaction
src/video/windows/SDL_windowsmouse.c
--- a/src/video/windows/SDL_windowsmouse.c	Mon Feb 24 22:49:30 2014 -0800
+++ b/src/video/windows/SDL_windowsmouse.c	Mon Feb 24 23:09:35 2014 -0800
@@ -183,9 +183,15 @@
 static void
 WIN_WarpMouse(SDL_Window * window, int x, int y)
 {
-    HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
+    SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
+    HWND hwnd = data->hwnd;
     POINT pt;
 
+    /* Don't warp the mouse while we're doing a modal interaction */
+    if (data->in_title_click || data->in_modal_loop) {
+        return;
+    }
+
     pt.x = x;
     pt.y = y;
     ClientToScreen(hwnd, &pt);