From 63bfef7c69634b3ea85fc5d75c031a4b29c512c7 Mon Sep 17 00:00:00 2001 From: bicarus <202771338+bicarus-dev@users.noreply.github.com> Date: Thu, 29 Oct 2026 20:05:26 -0700 Subject: [PATCH] fix sdvx windowed mode mouse emulation double register --- src/spice2x/touch/native/inject_mouse.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/spice2x/touch/native/inject_mouse.cpp b/src/spice2x/touch/native/inject_mouse.cpp index 2d3d81f3..a2ac214d 100644 --- a/src/spice2x/touch/native/inject_mouse.cpp +++ b/src/spice2x/touch/native/inject_mouse.cpp @@ -7,6 +7,7 @@ #include "settings.h" #include "transform.h" +#include "hooks/graphics/graphics.h" #include "touch/touch.h" #include "util/logging.h" @@ -141,6 +142,13 @@ namespace nativetouch::inject { end_mouse_contact(window); } + // SDVX accepts both mouse and touch on its windowed subscreen, causing duplicate input. + if (GRAPHICS_WINDOWED && + window == SDVX_SUBSCREEN_WINDOW && + message >= WM_MOUSEFIRST && message <= WM_MOUSELAST) { + return true; + } + return false; } }