summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2018-02-07 17:02:45 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2018-02-08 01:01:13 +0100
commitc93886a5ea884fffa1c01384e5e0873140a1b8e7 (patch)
treef83560382d1ad0ccebc4b3a8c03d7002ce4707d2 /kde-apps/konsole/files
parentdev-qt/qtgui: Fix libinput wheelevents (diff)
downloadgentoo-c93886a5ea884fffa1c01384e5e0873140a1b8e7.tar.gz
gentoo-c93886a5ea884fffa1c01384e5e0873140a1b8e7.tar.bz2
gentoo-c93886a5ea884fffa1c01384e5e0873140a1b8e7.zip
kde-apps/konsole: Fix mouse wheel scrolling w/ libinput
KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=386762 Package-Manager: Portage-2.3.24, Repoman-2.3.6
Diffstat (limited to 'kde-apps/konsole/files')
-rw-r--r--kde-apps/konsole/files/konsole-17.12.1-libinput-pixeldelta.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/kde-apps/konsole/files/konsole-17.12.1-libinput-pixeldelta.patch b/kde-apps/konsole/files/konsole-17.12.1-libinput-pixeldelta.patch
new file mode 100644
index 000000000000..37049b9b2f2a
--- /dev/null
+++ b/kde-apps/konsole/files/konsole-17.12.1-libinput-pixeldelta.patch
@@ -0,0 +1,54 @@
+From d25e5ac7089f2c81cc5ffe8e155ba8b3dfb11b97 Mon Sep 17 00:00:00 2001
+From: Kurt Hindenburg <kurt.hindenburg@gmail.com>
+Date: Wed, 7 Feb 2018 10:38:09 -0500
+Subject: Fix mouse wheel scrolling with libinput
+
+If the Libinput X server input driver is used we get a value for
+pixelDelta for a physical mouse wheel scroll, so we check that the
+source of the wheel event is actually a mouse, this was fixed in
+Qt 5.9.5*
+https://bugreports.qt.io/browse/QTBUG-59261
+
+Patch by ahmadsamir
+
+* fixed in Gentoo: Qt 5.9.4
+
+BUG: 386762
+Differential Revision: https://phabricator.kde.org/D9008
+---
+ src/ScrollState.cpp | 19 +++++++++++++++----
+ 1 file changed, 15 insertions(+), 4 deletions(-)
+
+diff --git a/src/ScrollState.cpp b/src/ScrollState.cpp
+index e5b486d..f71b142 100644
+--- a/src/ScrollState.cpp
++++ b/src/ScrollState.cpp
+@@ -25,10 +25,21 @@ using namespace Konsole;
+
+ void ScrollState::addWheelEvent(const QWheelEvent *wheel)
+ {
+- if ((wheel->angleDelta().y() != 0) && (wheel->pixelDelta().y() == 0)) {
+- _remainingScrollPixel = 0;
+- } else {
+- _remainingScrollPixel += wheel->pixelDelta().y();
++ // If the Libinput X server input driver is used we get a value for
++ // pixelDelta for a physical mouse wheel scroll, so we check that
++ // the source of the wheel event is actually a mouse, this has been
++ // fixed upstream in Qt 5.9.5: https://bugreports.qt.io/browse/QTBUG-59261
++ // Fixes Konsole BUG: https://bugs.kde.org/show_bug.cgi?id=386762
++#if (QT_VERSION < QT_VERSION_CHECK(5, 9, 4))
++ if (wheel->source() != Qt::MouseEventNotSynthesized) {
++#else
++ if (true) {
++#endif
++ if ((wheel->angleDelta().y() != 0) && (wheel->pixelDelta().y() == 0)) {
++ _remainingScrollPixel = 0;
++ } else {
++ _remainingScrollPixel += wheel->pixelDelta().y();
++ }
+ }
+ _remainingScrollAngle += wheel->angleDelta().y();
+ }
+--
+cgit v0.11.2
+