[pim/mimetreeparser] src/quick: Also handle pixel delta in wheel interceptor
Claudio Cambra <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit cecf33c3a2cdd436bd5718d7c1b0ac36fea764ff by Claudio Cambra.
Committed on 16/08/2026 at 16:51.
Pushed by clau-cambra into branch 'master'.
Also handle pixel delta in wheel interceptor
M +8 -2 src/quick/wheelinterceptor.cpp
https://invent.kde.org/pim/mimetreeparser/-/commit/cecf33c3a2cdd436bd5718d7c1b0ac36fea764ff
diff --git a/src/quick/wheelinterceptor.cpp b/src/quick/wheelinterceptor.cpp
index e097e81..69ddc60 100644
--- a/src/quick/wheelinterceptor.cpp
+++ b/src/quick/wheelinterceptor.cpp
@@ -101,10 +101,16 @@ bool WheelInterceptor::eventFilter(QObject *obj, QEvent *event)
return false;
}
+ const auto pixelDelta = wheelEvent->pixelDelta();
+ const auto angleDelta = wheelEvent->angleDelta();
const auto scrollLines = QGuiApplication::styleHints()->wheelScrollLines();
const auto factor = scrollLines * 20.0 / 120.0;
- const auto deltaY = -wheelEvent->angleDelta().y() * factor;
- const auto deltaX = -wheelEvent->angleDelta().x() * factor;
+ const auto deltaY = pixelDelta.y() != 0 ? -pixelDelta.y() : -angleDelta.y() * factor;
+ const auto deltaX = pixelDelta.x() != 0 ? -pixelDelta.x() : -angleDelta.x() * factor;
+
+ if (deltaX == 0.0 && deltaY == 0.0) {
+ return false;
+ }
if (m_target) {
applyScroll(m_target, deltaY);