summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-12-12 09:23:04 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-12-19 09:29:22 +0000
commitd04187b6a17c16cc455a330fd3e3350016dcc889 (patch)
tree6e4f3686a53e923d9514e5486784e044a4080d68 /src/plugins/platforms/windows
parent23c55cd37ce1de489cf7c405a9d21781cbcb1ade (diff)
Windows QPA: Check validity of device when handling tablet leave
Huion GT-191 has been observed to send spurious leave events. Amends 127483b5e30de6c1905ea3280dd45a0b7d6a3813. Task-number: QTBUG-65120 Change-Id: I5dfa003a71be137a7b40cc9c27d7cf2cada6922d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r--src/plugins/platforms/windows/qwindowstabletsupport.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
index fba4e8f386..5fdc664603 100644
--- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp
+++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
@@ -355,6 +355,8 @@ bool QWindowsTabletSupport::translateTabletProximityEvent(WPARAM /* wParam */, L
if (!LOWORD(lParam)) {
qCDebug(lcQpaTablet) << "leave proximity for device #" << m_currentDevice;
+ if (m_currentDevice < 0 || m_currentDevice >= m_devices.size()) // QTBUG-65120, spurious leave observed
+ return false;
if (totalPacks > 0) {
QWindowSystemInterface::handleTabletLeaveProximityEvent(proximityBuffer[0].pkTime,
m_devices.at(m_currentDevice).currentDevice,