From e5efde9481217d65adf00c435abf52e8e75b9388 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Sun, 4 Aug 2024 20:07:14 +0300 Subject: [PATCH] [Windows] Reject WM_POINTER(UP/DOWN) messages for non pen pointer type. --- platform/windows/display_server_windows.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 36f3f632d51..8ebb84f883b 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -4250,6 +4250,16 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA break; } + uint32_t pointer_id = LOWORD(wParam); + POINTER_INPUT_TYPE pointer_type = PT_POINTER; + if (!win8p_GetPointerType(pointer_id, &pointer_type)) { + break; + } + + if (pointer_type != PT_PEN) { + break; + } + Ref mb; mb.instantiate(); mb->set_window_id(window_id);