summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-10-16 15:34:35 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-10-17 12:45:11 +0000
commit127483b5e30de6c1905ea3280dd45a0b7d6a3813 (patch)
treee7d145b43f16f5727beb2bb9a3862f434d9eb82e
parent198225983df9f402bb368b449f1abeea95ff0dce (diff)
Windows QPA: Fix reporting of TabletLeaveProximity events
Move the check for totalPacks below; it prevents leave notifications from being handled. Task-number: QTBUG-53628 Change-Id: I2436c51308803337e6d48ef958e03123283d4a1d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r--src/plugins/platforms/windows/qwindowstabletsupport.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
index 7e1017426f..5fe58fbfa5 100644
--- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp
+++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
@@ -352,16 +352,26 @@ bool QWindowsTabletSupport::translateTabletProximityEvent(WPARAM /* wParam */, L
{
PACKET proximityBuffer[1]; // we are only interested in the first packet in this case
const int totalPacks = QWindowsTabletSupport::m_winTab32DLL.wTPacketsGet(m_context, 1, proximityBuffer);
- if (!totalPacks)
- return false;
+
if (!LOWORD(lParam)) {
qCDebug(lcQpaTablet) << "leave proximity for device #" << m_currentDevice;
- QWindowSystemInterface::handleTabletLeaveProximityEvent(proximityBuffer[0].pkTime,
- m_devices.at(m_currentDevice).currentDevice,
- m_devices.at(m_currentDevice).currentPointerType,
- m_devices.at(m_currentDevice).uniqueId);
+ if (totalPacks > 0) {
+ QWindowSystemInterface::handleTabletLeaveProximityEvent(proximityBuffer[0].pkTime,
+ m_devices.at(m_currentDevice).currentDevice,
+ m_devices.at(m_currentDevice).currentPointerType,
+ m_devices.at(m_currentDevice).uniqueId);
+ } else {
+ QWindowSystemInterface::handleTabletLeaveProximityEvent(m_devices.at(m_currentDevice).currentDevice,
+ m_devices.at(m_currentDevice).currentPointerType,
+ m_devices.at(m_currentDevice).uniqueId);
+
+ }
return true;
}
+
+ if (!totalPacks)
+ return false;
+
const UINT currentCursor = proximityBuffer[0].pkCursor;
UINT physicalCursorId;
QWindowsTabletSupport::m_winTab32DLL.wTInfo(WTI_CURSORS + currentCursor, CSR_PHYSID, &physicalCursorId);