From 7e09718dfeb8421fe15eaf290227a04fbd17c68f Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 7 Jul 2019 11:23:16 -0700 Subject: [PATCH] Ignore synthetic mouse events generated for touchscreens Windows generates fake raw mouse events for touchscreens for compatibility with legacy apps that predate touch support in Windows. We already handle touch events explicitly, so drop the synthetic events to avoid duplicates. --- src/video/windows/SDL_windowsevents.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index e3eaf8f93ecbb..2c9401b6bca9e 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -552,8 +552,8 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) GetRawInputData(hRawInput, RID_INPUT, &inp, &size, sizeof(RAWINPUTHEADER)); - /* Mouse data */ - if (inp.header.dwType == RIM_TYPEMOUSE) { + /* Mouse data (ignoring synthetic mouse events generated for touchscreens) */ + if (inp.header.dwType == RIM_TYPEMOUSE && (GetMessageExtraInfo() & 0x80) == 0) { if (isRelative) { RAWMOUSE* rawmouse = &inp.data.mouse;