From edd1ec389b3388c77c1ec618aec1d8f5b61f510b Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Thu, 13 May 2021 17:05:53 +0200 Subject: [PATCH] input: Use specific API No need to construct values that are already provided --- src/input.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index 9d16212bfd..5147bf4d24 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -950,7 +950,7 @@ class InternalWindowEventFilter : public InputEventFilter { } } } - const QPointF localPos = event->globalPosF() - QPointF(internal->x(), internal->y()); + const QPointF localPos = event->globalPosF() - internal->position(); const Qt::Orientation orientation = (event->angleDelta().x() != 0) ? Qt::Horizontal : Qt::Vertical; const int delta = event->angleDelta().x() != 0 ? event->angleDelta().x() : event->angleDelta().y(); QWheelEvent e(localPos, event->globalPosF(), QPoint(), @@ -1033,7 +1033,7 @@ class InternalWindowEventFilter : public InputEventFilter { touch->setInternalPressId(id); // Qt's touch event API is rather complex, let's do fake mouse events instead m_lastGlobalTouchPos = pos; - m_lastLocalTouchPos = pos - QPointF(internal->x(), internal->y()); + m_lastLocalTouchPos = pos - internal->position(); QEnterEvent enterEvent(m_lastLocalTouchPos, m_lastLocalTouchPos, pos); QCoreApplication::sendEvent(internal, &enterEvent);