From e2203163d9cd03165142d98fa9ba8aaf5a9c3085 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 15 Jul 2014 16:57:27 +0200 Subject: Windows: Send QTabletLeaveProximity events. Proximity leave comes without packets, do not bail out. Task-number: QTBUG-40019 Change-Id: I4e6b4ca13ad875bdfdcd31f86b08de4a596e76cb Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- .../platforms/windows/qwindowstabletsupport.cpp | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp index 2a1e5c58b9..8ceab02311 100644 --- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp +++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the plugins of the Qt Toolkit. @@ -347,7 +347,13 @@ QWindowsTabletDeviceData QWindowsTabletSupport::tabletInit(const quint64 uniqueI bool QWindowsTabletSupport::translateTabletProximityEvent(WPARAM /* wParam */, LPARAM lParam) { - const bool enteredProximity = LOWORD(lParam) != 0; + if (!LOWORD(lParam)) { + qCDebug(lcQpaTablet) << "leave proximity for device #" << m_currentDevice; + QWindowSystemInterface::handleTabletLeaveProximityEvent(m_devices.at(m_currentDevice).currentDevice, + m_devices.at(m_currentDevice).currentPointerType, + m_devices.at(m_currentDevice).uniqueId); + return true; + } 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) @@ -367,17 +373,11 @@ bool QWindowsTabletSupport::translateTabletProximityEvent(WPARAM /* wParam */, L m_devices.push_back(tabletInit(uniqueId, cursorType)); } m_devices[m_currentDevice].currentPointerType = pointerType(currentCursor); - qCDebug(lcQpaTablet) << __FUNCTION__ << (enteredProximity ? "enter" : "leave") - << " proximity for device #" << m_currentDevice << m_devices.at(m_currentDevice); - if (enteredProximity) { - QWindowSystemInterface::handleTabletEnterProximityEvent(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); - } + qCDebug(lcQpaTablet) << "enter proximity for device #" + << m_currentDevice << m_devices.at(m_currentDevice); + QWindowSystemInterface::handleTabletEnterProximityEvent(m_devices.at(m_currentDevice).currentDevice, + m_devices.at(m_currentDevice).currentPointerType, + m_devices.at(m_currentDevice).uniqueId); return true; } -- cgit v1.2.3