diff --git a/autotests/integration/pointer_input.cpp b/autotests/integration/pointer_input.cpp index 1d5e603d91..c5a0b1a434 100644 --- a/autotests/integration/pointer_input.cpp +++ b/autotests/integration/pointer_input.cpp @@ -1520,9 +1520,9 @@ void PointerInputTest::testConfineToScreenGeometry_data() QTest::newRow("move top - top screen") << QPoint(1920, 512) << QPoint(1920, -100) << QPoint(1920, 0); QTest::newRow("move top-right - top screen") << QPoint(1920, 512) << QPoint(2660, -100) << QPoint(2660, 0); QTest::newRow("move right - top screen") << QPoint(1920, 512) << QPoint(2660, 512) << QPoint(2660, 512); - QTest::newRow("move bottom-right - top screen") << QPoint(1920, 512) << QPoint(2660, 1124) << QPoint(2559, 1023); + QTest::newRow("move bottom-right - top screen") << QPoint(1920, 512) << QPoint(2660, 1124) << QPoint(2660, 1023); QTest::newRow("move bottom - top screen") << QPoint(1920, 512) << QPoint(1920, 1124) << QPoint(1920, 1124); - QTest::newRow("move bottom-left - top screen") << QPoint(1920, 512) << QPoint(1180, 1124) << QPoint(1280, 1023); + QTest::newRow("move bottom-left - top screen") << QPoint(1920, 512) << QPoint(1180, 1124) << QPoint(1180, 1023); QTest::newRow("move left - top screen") << QPoint(1920, 512) << QPoint(1180, 512) << QPoint(1180, 512); QTest::newRow("move top-left - right screen") << QPoint(3200, 512) << QPoint(2460, -100) << QPoint(2460, 0); diff --git a/src/pointer_input.cpp b/src/pointer_input.cpp index 180b546d4a..8b2a219acc 100644 --- a/src/pointer_input.cpp +++ b/src/pointer_input.cpp @@ -745,15 +745,8 @@ void PointerInputRedirection::updatePosition(const QPointF &pos) return; } // verify that at least one screen contains the pointer position - QPointF p = pos; - if (!screenContainsPos(p)) { - const QRectF unitedScreensGeometry = workspace()->geometry(); - p = confineToBoundingBox(p, unitedScreensGeometry); - if (!screenContainsPos(p)) { - const Output *currentOutput = workspace()->outputAt(m_pos); - p = confineToBoundingBox(p, currentOutput->geometry()); - } - } + const Output *currentOutput = workspace()->outputAt(pos); + QPointF p = confineToBoundingBox(pos, currentOutput->geometry()); p = applyPointerConfinement(p); if (p == m_pos) { // didn't change due to confinement