From 488b94cb403abe334ccd7f6439f4acd290630ba6 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 7 Apr 2020 09:18:19 -0700 Subject: [PATCH] Don't interpret raw input messages with no mouse position This happens occasionally on touch devices when raw input is enabled --- src/video/windows/SDL_windowsevents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index 516ecdd2327aa..52e4603c9947f 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -609,7 +609,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if ((rawmouse->usFlags & 0x01) == MOUSE_MOVE_RELATIVE) { SDL_SendMouseMotion(data->window, 0, 1, (int)rawmouse->lLastX, (int)rawmouse->lLastY); - } else { + } else if (rawmouse->lLastX || rawmouse->lLastY) { /* synthesize relative moves from the abs position */ static SDL_Point lastMousePoint; SDL_bool virtual_desktop = (rawmouse->usFlags & MOUSE_VIRTUAL_DESKTOP) ? SDL_TRUE : SDL_FALSE;