Bläddra i källkod

Don't warp the mouse while we're doing a modal interaction

Sam Lantinga 11 år sedan
förälder
incheckning
b420ad0e01
1 ändrade filer med 7 tillägg och 1 borttagningar
  1. 7 1
      src/video/windows/SDL_windowsmouse.c

+ 7 - 1
src/video/windows/SDL_windowsmouse.c

@@ -183,9 +183,15 @@ WIN_ShowCursor(SDL_Cursor * cursor)
 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);