From b420ad0e019f8935488b20b62adb5f598b23447a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 24 Feb 2014 23:09:35 -0800 Subject: [PATCH] Don't warp the mouse while we're doing a modal interaction --- src/video/windows/SDL_windowsmouse.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/video/windows/SDL_windowsmouse.c b/src/video/windows/SDL_windowsmouse.c index 1c27095a92321..183e71c7e9b08 100644 --- a/src/video/windows/SDL_windowsmouse.c +++ b/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);