diff --git a/src/ScrollState.cpp b/src/ScrollState.cpp --- a/src/ScrollState.cpp +++ b/src/ScrollState.cpp @@ -25,10 +25,18 @@ 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 should workaround the bug until it's fixed + // upstream: https://bugreports.qt.io/browse/QTBUG-59261 + // Fixes Konsole bug: https://bugs.kde.org/show_bug.cgi?id=386762 + if (wheel->source() != Qt::MouseEventNotSynthesized) { + if ((wheel->angleDelta().y() != 0) && (wheel->pixelDelta().y() == 0)) { + _remainingScrollPixel = 0; + } else { + _remainingScrollPixel += wheel->pixelDelta().y(); + } } _remainingScrollAngle += wheel->angleDelta().y(); }