diff --git a/autotests/integration/screens_test.cpp b/autotests/integration/screens_test.cpp index 757e3837ab..092f8bfbf8 100644 --- a/autotests/integration/screens_test.cpp +++ b/autotests/integration/screens_test.cpp @@ -34,8 +34,6 @@ private Q_SLOTS: void testSize_data(); void testSize(); void testCount(); - void testIntersecting_data(); - void testIntersecting(); void testCurrent_data(); void testCurrent(); void testCurrentWithFollowsMouse_data(); @@ -142,35 +140,6 @@ void ScreensTest::testCount() QCOMPARE(countChangedSpy.count(), 1); } -void ScreensTest::testIntersecting_data() -{ - QTest::addColumn>("geometries"); - QTest::addColumn("testGeometry"); - QTest::addColumn("expectedCount"); - - QTest::newRow("null-rect") << QVector{{QRect{0, 0, 100, 100}}} << QRect() << 0; - QTest::newRow("non-overlapping") << QVector{{QRect{0, 0, 100, 100}}} << QRect(100, 0, 100, 100) << 0; - QTest::newRow("in-between") << QVector{{QRect{0, 0, 10, 20}, QRect{20, 40, 10, 20}}} << QRect(15, 0, 2, 2) << 0; - QTest::newRow("gap-overlapping") << QVector{{QRect{0, 0, 10, 20}, QRect{20, 40, 10, 20}}} << QRect(9, 10, 200, 200) << 2; - QTest::newRow("larger") << QVector{{QRect{0, 0, 100, 100}}} << QRect(-10, -10, 200, 200) << 1; - QTest::newRow("several") << QVector{{QRect{0, 0, 100, 100}, QRect{100, 0, 100, 100}, QRect{200, 100, 100, 100}, QRect{300, 100, 100, 100}}} << QRect(0, 0, 300, 300) << 3; -} - -void ScreensTest::testIntersecting() -{ - QSignalSpy changedSpy(screens(), &Screens::changed); - QVERIFY(changedSpy.isValid()); - - QFETCH(QVector, geometries); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::QueuedConnection, - Q_ARG(int, geometries.count()), Q_ARG(QVector, geometries)); - QVERIFY(changedSpy.wait()); - - QFETCH(QRect, testGeometry); - QCOMPARE(screens()->count(), geometries.count()); - QTEST(screens()->intersecting(testGeometry), "expectedCount"); -} - void ScreensTest::testCurrent_data() { QTest::addColumn("currentId"); diff --git a/src/screens.cpp b/src/screens.cpp index 6b3428e3db..548547d32a 100644 --- a/src/screens.cpp +++ b/src/screens.cpp @@ -107,17 +107,6 @@ void Screens::setCount(int count) Q_EMIT countChanged(previous, count); } -int Screens::intersecting(const QRect &r) const -{ - int cnt = 0; - for (int i = 0; i < count(); ++i) { - if (geometry(i).intersects(r)) { - ++cnt; - } - } - return cnt; -} - int Screens::number(const QPoint &pos) const { return kwinApp()->platform()->enabledOutputs().indexOf(kwinApp()->platform()->outputAt(pos)); diff --git a/src/screens.h b/src/screens.h index cdd70bbf73..8fbff0d19c 100644 --- a/src/screens.h +++ b/src/screens.h @@ -64,8 +64,6 @@ public: QSize size() const; int number(const QPoint &pos) const; - int intersecting(const QRect &r) const; - Q_SIGNALS: void countChanged(int previousCount, int newCount); /**