Commit 62e6d338 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Update linux patches to Qt 5.12.4

Two patches were merged upstream:
0010-Fix-tablet-jitter-on-X11.patch
0011-Add-an-ID-for-recognition-of-UGEE-tablets.patch
parent c7407227
From a05a69e789006bbf3fbfdd1998bc58af7b826b4b Mon Sep 17 00:00:00 2001
From: Dmitry Kazakov <dimula73@gmail.com>
Date: Sun, 10 Mar 2019 14:48:58 +0300
Subject: [PATCH] Fix tablet jitter on X11
We should get the correct stylus position from the valuators,
not from the X11-provided global position. Global position is rounded
to the nearest FP16 values, which is not enough for smooth painting.
Change-Id: Ie701446b3586296bcb8fb09158f387ba6a7cbf07
---
src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 26 ++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index 04ddd3c..20aca33 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -1208,6 +1208,11 @@ bool QXcbConnection::xi2HandleTabletEvent(const void *event, TabletData *tabletD
return handled;
}
+inline qreal scaleOneValuator(qreal normValue, qreal screenMin, qreal screenSize)
+{
+ return screenMin + normValue * screenSize;
+}
+
void QXcbConnection::xi2ReportTabletEvent(const void *event, TabletData *tabletData)
{
auto *ev = reinterpret_cast<const qt_xcb_input_device_event_t *>(event);
@@ -1221,6 +1226,15 @@ void QXcbConnection::xi2ReportTabletEvent(const void *event, TabletData *tabletD
double pressure = 0, rotation = 0, tangentialPressure = 0;
int xTilt = 0, yTilt = 0;
+ // Valuators' values are relative to the physical size of the current virtual
+ // screen. Therefore we cannot use QScreen/QWindow geometry and should use
+ // QPlatformWindow/QPlatformScreen instead.
+ QRect physicalScreenArea;
+ const QList<QPlatformScreen *> siblings = window->screen()->handle()->virtualSiblings();
+ for (const QPlatformScreen *screen : siblings) {
+ physicalScreenArea |= screen->geometry();
+ }
+
for (QHash<int, TabletData::ValuatorClassInfo>::iterator it = tabletData->valuatorInfo.begin(),
ite = tabletData->valuatorInfo.end(); it != ite; ++it) {
int valuator = it.key();
@@ -1228,6 +1242,18 @@ void QXcbConnection::xi2ReportTabletEvent(const void *event, TabletData *tabletD
xi2GetValuatorValueIfSet(event, classInfo.number, &classInfo.curVal);
double normalizedValue = (classInfo.curVal - classInfo.minVal) / (classInfo.maxVal - classInfo.minVal);
switch (valuator) {
+ case QXcbAtom::AbsX: {
+ const qreal value = scaleOneValuator(normalizedValue, physicalScreenArea.x(), physicalScreenArea.width());
+ global.setX(value);
+ local.setX(value - window->handle()->geometry().x());
+ break;
+ }
+ case QXcbAtom::AbsY: {
+ qreal value = scaleOneValuator(normalizedValue, physicalScreenArea.y(), physicalScreenArea.height());
+ global.setY(value);
+ local.setY(value - window->handle()->geometry().y());
+ break;
+ }
case QXcbAtom::AbsPressure:
pressure = normalizedValue;
break;
--
2.7.4
From 8b82ab988807cd424e2e54b29dea4cde8e687fab Mon Sep 17 00:00:00 2001
From: Dmitry Kazakov <dimula73@gmail.com>
Date: Sun, 10 Mar 2019 14:51:28 +0300
Subject: [PATCH] Add an ID for recognition of UGEE tablets
Change-Id: I2228ee9d53aa23a2d2cd9970a363d8424e744093
---
src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index 20aca33..411366f 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -240,6 +240,10 @@ void QXcbConnection::xi2SetupDevice(void *info, bool removeExisting)
} else if (name.contains("uc-logic") && isTablet) {
tabletData.pointerType = QTabletEvent::Pen;
dbgType = QLatin1String("pen");
+ } else if (name.contains("ugee")) {
+ isTablet = true;
+ tabletData.pointerType = QTabletEvent::Pen;
+ dbgType = QLatin1String("pen");
} else {
isTablet = false;
}
--
2.7.4
From a36e3651fe79bbbdea44d78e11a97705687cffa9 Mon Sep 17 00:00:00 2001 From 0ae8de8731d39fd1e736c7d9012f87184299956e Mon Sep 17 00:00:00 2001
From: Dmitry Kazakov <dimula73@gmail.com> From: Dmitry Kazakov <dimula73@gmail.com>
Date: Mon, 11 Mar 2019 13:18:06 +0300 Date: Mon, 11 Mar 2019 13:18:06 +0300
Subject: [PATCH] Synthesize Enter/LeaveEvent for accepted QTabletEvent Subject: [PATCH 1/2] Synthesize Enter/LeaveEvent for accepted QTabletEvent
When the tablet event is accepted, then Qt doesn't synthesize a mouse When the tablet event is accepted, then Qt doesn't synthesize a mouse
event, it means that QApplicationPrivate::sendMouseEvent() will not be event, it means that QApplicationPrivate::sendMouseEvent() will not be
...@@ -19,10 +19,10 @@ Change-Id: Ifbad6284483ee282ad129db54606f5d0d9ddd633 ...@@ -19,10 +19,10 @@ Change-Id: Ifbad6284483ee282ad129db54606f5d0d9ddd633
1 file changed, 5 insertions(+) 1 file changed, 5 insertions(+)
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index e9b749d..983ab77 100644 index fbc71cd0ea..25cb486915 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp --- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -1053,6 +1053,11 @@ void QWidgetWindow::handleTabletEvent(QTabletEvent *event) @@ -1051,6 +1051,11 @@ void QWidgetWindow::handleTabletEvent(QTabletEvent *event)
event->setAccepted(ev.isAccepted()); event->setAccepted(ev.isAccepted());
} }
...@@ -35,5 +35,5 @@ index e9b749d..983ab77 100644 ...@@ -35,5 +35,5 @@ index e9b749d..983ab77 100644
qt_tablet_target = 0; qt_tablet_target = 0;
} }
-- --
2.7.4 2.20.1.windows.1
From 6851994441cc48cf48853f009dd620e9cebd551a Mon Sep 17 00:00:00 2001 From 82c789f75fc634ccbe5f1aad6d41895a6e6da17d Mon Sep 17 00:00:00 2001
From: Dmitry Kazakov <dimula73@gmail.com> From: Dmitry Kazakov <dimula73@gmail.com>
Date: Mon, 11 Mar 2019 16:17:17 +0300 Date: Mon, 11 Mar 2019 16:17:17 +0300
Subject: [PATCH] Poison Qt's headers with a mark about presence of Enter/Leave Subject: [PATCH 2/2] Poison Qt's headers with a mark about presence of
patch Enter/Leave patch
--- ---
src/gui/kernel/qevent.h | 4 ++++ src/gui/kernel/qevent.h | 4 ++++
1 file changed, 4 insertions(+) 1 file changed, 4 insertions(+)
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index 2b1c6a6..69cafaa 100644 index 2b1c6a6e31..69cafaaa29 100644
--- a/src/gui/kernel/qevent.h --- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h
@@ -242,6 +242,10 @@ protected: @@ -242,6 +242,10 @@ protected:
...@@ -24,5 +24,5 @@ index 2b1c6a6..69cafaa 100644 ...@@ -24,5 +24,5 @@ index 2b1c6a6..69cafaa 100644
class Q_GUI_EXPORT QTabletEvent : public QInputEvent class Q_GUI_EXPORT QTabletEvent : public QInputEvent
{ {
-- --
2.7.4 2.20.1.windows.1
...@@ -107,9 +107,7 @@ elseif (NOT APPLE) ...@@ -107,9 +107,7 @@ elseif (NOT APPLE)
URL https://download.qt.io/official_releases/qt/5.12/5.12.4/single/qt-everywhere-src-5.12.4.tar.xz URL https://download.qt.io/official_releases/qt/5.12/5.12.4/single/qt-everywhere-src-5.12.4.tar.xz
URL_MD5 dda95b0239d13c5276834177af3a8588 URL_MD5 dda95b0239d13c5276834177af3a8588
PATCH_COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0010-Fix-tablet-jitter-on-X11.patch PATCH_COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0012-Synthesize-Enter-LeaveEvent-for-accepted-QTabletEven.patch
COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0011-Add-an-ID-for-recognition-of-UGEE-tablets.patch
COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0012-Synthesize-Enter-LeaveEvent-for-accepted-QTabletEven.patch
COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0013-Poison-Qt-s-headers-with-a-mark-about-presence-of-En.patch COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0013-Poison-Qt-s-headers-with-a-mark-about-presence-of-En.patch
CMAKE_ARGS -DOPENSSL_LIBS='-L${EXTPREFIX_qt}/lib -lssl -lcrypto' CMAKE_ARGS -DOPENSSL_LIBS='-L${EXTPREFIX_qt}/lib -lssl -lcrypto'
......
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