From 15958a7cbad081c3e444752249f51aef9d62a792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20de=20la=20Rocha?= Date: Tue, 16 Nov 2021 00:07:09 +0100 Subject: Windows QPA: Fix multi-touch support in some devices Some multi-touch devices send touch information for each finger using different WM_POINTER messages/frames, instead of a single one with a list of touches, like most devices. This would result in the generation of multiple touch events, which can cause unexpected behavior in applications (the QTouchEvent documentation specifies that it should contain all simultaneous touches). This patch adds a workaround to ensure all simultaneous touches are included in the events, to comply with the expected behavior. Change-Id: I12a2f84b35a6bdd49ee53d25de580c0941a9aea6 Reviewed-by: Shawn Rutledge Reviewed-by: Oliver Wolff (cherry picked from commit 8283df4d8cee7e80ce36e724ae0824fd1e00cb24) Reviewed-by: Qt CI Bot --- src/plugins/platforms/windows/qwindowspointerhandler.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/windows/qwindowspointerhandler.h') diff --git a/src/plugins/platforms/windows/qwindowspointerhandler.h b/src/plugins/platforms/windows/qwindowspointerhandler.h index ba211bbc01..58624fb81f 100644 --- a/src/plugins/platforms/windows/qwindowspointerhandler.h +++ b/src/plugins/platforms/windows/qwindowspointerhandler.h @@ -47,6 +47,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -74,7 +75,7 @@ private: void handleEnterLeave(QWindow *window, QWindow *currentWindowUnderPointer, QPoint globalPos); QTouchDevice *m_touchDevice = nullptr; - QHash m_lastTouchPositions; + QHash m_lastTouchPoints; QHash m_touchInputIDToTouchPointID; QPointer m_windowUnderPointer; QPointer m_currentWindow; -- cgit v1.2.3