From 0c5da45cfce79454d55b6a827a245e9c5724cd57 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 14 Jul 2022 11:59:59 +0100 Subject: [PATCH] Drop multiple point rounding in input code Input is floating but was rounded when we entered kwin logic. This is no longer needed after more floating point support was added to the core. --- src/pointer_input.cpp | 10 +++++----- src/tablet_input.cpp | 2 +- src/touch_input.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pointer_input.cpp b/src/pointer_input.cpp index b5ee287bcf..ccc3c881a5 100644 --- a/src/pointer_input.cpp +++ b/src/pointer_input.cpp @@ -534,7 +534,7 @@ void PointerInputRedirection::cleanupDecoration(Decoration::DecoratedClientImpl auto pos = m_pos - now->window()->pos(); QHoverEvent event(QEvent::HoverEnter, pos, pos); QCoreApplication::instance()->sendEvent(now->decoration(), &event); - now->window()->processDecorationMove(pos.toPoint(), m_pos.toPoint()); + now->window()->processDecorationMove(pos, m_pos); m_decorationGeometryConnection = connect( decoration()->window(), &Window::frameGeometryChanged, this, [this]() { @@ -565,7 +565,7 @@ void PointerInputRedirection::focusUpdate(Window *focusOld, Window *focusNow) m_focusGeometryConnection = QMetaObject::Connection(); if (focusNow && focusNow->isClient()) { - focusNow->pointerEnterEvent(m_pos.toPoint()); + focusNow->pointerEnterEvent(m_pos); } auto seat = waylandServer()->seat(); @@ -800,7 +800,7 @@ void PointerInputRedirection::updatePosition(const QPointF &pos) const QRectF unitedScreensGeometry = workspace()->geometry(); p = confineToBoundingBox(p, unitedScreensGeometry); if (!screenContainsPos(p)) { - const Output *currentOutput = kwinApp()->platform()->outputAt(m_pos.toPoint()); + const Output *currentOutput = kwinApp()->platform()->outputAt(m_pos); p = confineToBoundingBox(p, currentOutput->geometry()); } } @@ -884,14 +884,14 @@ void PointerInputRedirection::updateAfterScreenChange() return; } // pointer no longer on a screen, reposition to closes screen - const Output *output = kwinApp()->platform()->outputAt(m_pos.toPoint()); + const Output *output = kwinApp()->platform()->outputAt(m_pos); // TODO: better way to get timestamps processMotionAbsolute(output->geometry().center(), waylandServer()->seat()->timestamp()); } QPointF PointerInputRedirection::position() const { - return m_pos.toPoint(); + return m_pos; } void PointerInputRedirection::setEffectsOverrideCursor(Qt::CursorShape shape) diff --git a/src/tablet_input.cpp b/src/tablet_input.cpp index ae0e7f5e9a..d6d292504c 100644 --- a/src/tablet_input.cpp +++ b/src/tablet_input.cpp @@ -155,7 +155,7 @@ void TabletInputRedirection::cleanupDecoration(Decoration::DecoratedClientImpl * const auto pos = m_lastPosition - now->window()->pos(); QHoverEvent event(QEvent::HoverEnter, pos, pos); QCoreApplication::instance()->sendEvent(now->decoration(), &event); - now->window()->processDecorationMove(pos.toPoint(), m_lastPosition.toPoint()); + now->window()->processDecorationMove(pos, m_lastPosition); m_decorationGeometryConnection = connect( decoration()->window(), &Window::frameGeometryChanged, this, [this]() { diff --git a/src/touch_input.cpp b/src/touch_input.cpp index 8135999aa6..69132b976c 100644 --- a/src/touch_input.cpp +++ b/src/touch_input.cpp @@ -98,7 +98,7 @@ void TouchInputRedirection::focusUpdate(Window *focusOld, Window *focusNow) m_focusGeometryConnection = QMetaObject::Connection(); if (focusNow && focusNow->isClient()) { - focusNow->pointerEnterEvent(m_lastPosition.toPoint()); + focusNow->pointerEnterEvent(m_lastPosition); } auto seat = waylandServer()->seat();