Commit 069a657a authored by Boudewijn Rempt's avatar Boudewijn Rempt

Update this patch so it applies cleanly to 5.12.3

parent 7f254596
From 7dd05b77fe213ca2feb125503eb10c2567a4faee Mon Sep 17 00:00:00 2001
From: Dmitry Kazakov <dimula73@gmail.com>
Date: Thu, 18 Apr 2019 15:42:17 +0300
Subject: [PATCH] Fix updating tablet pressure resolution on every proximity
enter event
The user can switch pressure sensitivity level in the driver,
which will make our saved values invalid (this option is
provided by Wacom drivers for compatibility reasons, and
it can be adjusted on the fly)
See the bug: https://bugs.kde.org/show_bug.cgi?id=391054
---
src/plugins/platforms/windows/qwindowstabletsupport.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
index d82b33c1..3393b091 100644
--- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp
+++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
@@ -519,6 +519,14 @@ bool QWindowsTabletSupport::translateTabletProximityEvent(WPARAM /* wParam */, L
diff --git a/qtbase/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/qtbase/src/plugins/platforms/windows/qwindowstabletsupport.cpp
index fa209f09c..462be8b3f 100644
--- a/qtbase/src/plugins/platforms/windows/qwindowstabletsupport.cpp
+++ b/qtbase/src/plugins/platforms/windows/qwindowstabletsupport.cpp
@@ -434,6 +434,14 @@ bool QWindowsTabletSupport::translateTabletProximityEvent(WPARAM /* wParam */, L
if (m_currentDevice < 0) {
m_currentDevice = m_devices.size();
m_devices.push_back(tabletInit(uniqueId, cursorType));
......@@ -31,8 +15,42 @@ index d82b33c1..3393b091 100644
+ */
+ m_devices[m_currentDevice] = tabletInit(uniqueId, cursorType);
}
m_devices[m_currentDevice].currentPointerType = pointerType(currentCursor);
m_state = PenProximity;
@@ -454,7 +462,6 @@ bool QWindowsTabletSupport::translateTabletPacketEvent()
return false;
/**
--
2.20.1.windows.1
const int currentDevice = m_devices.at(m_currentDevice).currentDevice;
- const int currentPointer = m_devices.at(m_currentDevice).currentPointerType;
const qint64 uniqueId = m_devices.at(m_currentDevice).uniqueId;
// The tablet can be used in 2 different modes (reflected in enum Mode),
@@ -484,6 +491,28 @@ bool QWindowsTabletSupport::translateTabletPacketEvent()
for (int i = 0; i < packetCount ; ++i) {
const PACKET &packet = localPacketBuf[i];
+ int currentPointer = m_devices.at(m_currentDevice).currentPointerType;
+
+ const int packetPointerType = pointerType(packet.pkCursor);
+ if (!packet.pkButtons && packetPointerType != currentPointer) {
+
+ QWindowSystemInterface::handleTabletLeaveProximityEvent(packet.pkTime,
+ m_devices.at(m_currentDevice).currentDevice,
+ m_devices.at(m_currentDevice).currentPointerType,
+ m_devices.at(m_currentDevice).uniqueId);
+
+
+
+ m_devices[m_currentDevice].currentPointerType = packetPointerType;
+
+ QWindowSystemInterface::handleTabletEnterProximityEvent(packet.pkTime,
+ m_devices.at(m_currentDevice).currentDevice,
+ m_devices.at(m_currentDevice).currentPointerType,
+ m_devices.at(m_currentDevice).uniqueId);
+
+ currentPointer = packetPointerType;
+ }
+
const int z = currentDevice == QTabletEvent::FourDMouse ? int(packet.pkZ) : 0;
QPointF globalPosF =
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment