Commit 6806b44e authored by Dmitry Kazakov's avatar Dmitry Kazakov

Disable relative mode for the tablet in Qt

The current Qt's implementation of it may cause problems in normal
absolute painting. 20 px is rather normal difference between tablet
and mouse event streams.
parent 7c7becc7
From 30f28be2a239d82c2d7f2d6a37df4acb300d7cef Mon Sep 17 00:00:00 2001
From: Dmitry Kazakov <dimula73@gmail.com>
Date: Sat, 13 Apr 2019 20:29:14 +0300
Subject: [PATCH] Disable tablet relative mode in Qt
---
src/plugins/platforms/windows/qwindowstabletsupport.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
index 31655101..3e35b146 100644
--- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp
+++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
@@ -562,6 +562,11 @@ bool QWindowsTabletSupport::translateTabletPacketEvent()
m_state = PenDown;
m_mode = (mouseLocation - globalPosF).manhattanLength() > m_absoluteRange
? MouseMode : PenMode;
+
+ // Krita doesn't support mouse mode. And this code may break
+ // normal painting, so we just disable it.
+ m_mode = PenMode;
+
qCDebug(lcQpaTablet) << __FUNCTION__ << "mode=" << m_mode << "pen:"
<< globalPosF << "mouse:" << mouseLocation;
}
--
2.20.1.windows.1
......@@ -52,6 +52,7 @@ if (WIN32)
COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0022-Fix-generation-of-Leave-events-when-using-tablet-dev.patch
COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0023-Implement-a-switch-for-tablet-API-on-Windows.patch
COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0024-Fetch-stylus-button-remapping-from-WinTab-driver.patch
COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0025-Disable-tablet-relative-mode-in-Qt.patch
)
endif()
......
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