From 53df0e6619f16bbee45b4c764b3772e077879ced Mon Sep 17 00:00:00 2001 From: ulatekh Date: Fri, 21 Jan 2022 17:15:18 -0700 Subject: [PATCH] Fix the erroneous generation of mouse-down events from touch-move events. The issue is that MS Windows synthesizes a mouse-move event in response to touch-move events, and those mouse-move events are NOT labeled as coming from a touch (e.g. GetMouseMessageSource() will not return SDL_MOUSE_EVENT_SOURCE_TOUCH for those synthesized mouse-move events). In addition, there seems to be no way to prevent this from happening; https://gist.github.com/vbfox/1339671 claims to demonstrate a technique to prevent it, but in my experience, it doesn't work. Because of this, the "fallthrough" case can't test that the synthesized mouse-move came from a touch-move, and starts erroneously pressing down the mouse-button, leading to massive confusion in the client application. --- 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 471bbee867..34cbcac7b6 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -732,8 +732,8 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) } } } - /* don't break here, fall through to check the wParam like the button presses */ - SDL_FALLTHROUGH; + break; + case WM_LBUTTONUP: case WM_RBUTTONUP: case WM_MBUTTONUP: