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 8254f97b5166c158
parent 8253 75ad8ebb3768
child 8255 49af9be342cd
Don't warp the mouse while we're doing a modal interaction
src/video/windows/SDL_windowsmouse.c
     1.1 --- a/src/video/windows/SDL_windowsmouse.c	Mon Feb 24 22:49:30 2014 -0800
     1.2 +++ b/src/video/windows/SDL_windowsmouse.c	Mon Feb 24 23:09:35 2014 -0800
     1.3 @@ -183,9 +183,15 @@
     1.4  static void
     1.5  WIN_WarpMouse(SDL_Window * window, int x, int y)
     1.6  {
     1.7 -    HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
     1.8 +    SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
     1.9 +    HWND hwnd = data->hwnd;
    1.10      POINT pt;
    1.11  
    1.12 +    /* Don't warp the mouse while we're doing a modal interaction */
    1.13 +    if (data->in_title_click || data->in_modal_loop) {
    1.14 +        return;
    1.15 +    }
    1.16 +
    1.17      pt.x = x;
    1.18      pt.y = y;
    1.19      ClientToScreen(hwnd, &pt);