src/video/windows/SDL_windowsmouse.c
changeset 8254 f97b5166c158
parent 8252 3e4846dc97b1
child 8269 6e18328e25e0
equal deleted inserted replaced
8253:75ad8ebb3768 8254:f97b5166c158
   181 }
   181 }
   182 
   182 
   183 static void
   183 static void
   184 WIN_WarpMouse(SDL_Window * window, int x, int y)
   184 WIN_WarpMouse(SDL_Window * window, int x, int y)
   185 {
   185 {
   186     HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
   186     SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
       
   187     HWND hwnd = data->hwnd;
   187     POINT pt;
   188     POINT pt;
       
   189 
       
   190     /* Don't warp the mouse while we're doing a modal interaction */
       
   191     if (data->in_title_click || data->in_modal_loop) {
       
   192         return;
       
   193     }
   188 
   194 
   189     pt.x = x;
   195     pt.x = x;
   190     pt.y = y;
   196     pt.y = y;
   191     ClientToScreen(hwnd, &pt);
   197     ClientToScreen(hwnd, &pt);
   192     SetCursorPos(pt.x, pt.y);
   198     SetCursorPos(pt.x, pt.y);