From e4e5c5230075eec17954fd0592189bef4367c849 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Mon, 22 Apr 2024 18:50:36 +0200 Subject: [PATCH] autotests/integration: clean up remnants of "active output follows mouse" setting in screenstest --- autotests/integration/screens_test.cpp | 37 +++----------------------- src/main_x11.cpp | 2 +- 2 files changed, 5 insertions(+), 34 deletions(-) diff --git a/autotests/integration/screens_test.cpp b/autotests/integration/screens_test.cpp index 265707024e..82e2492766 100644 --- a/autotests/integration/screens_test.cpp +++ b/autotests/integration/screens_test.cpp @@ -30,10 +30,8 @@ private Q_SLOTS: void initTestCase(); void init(); void cleanup(); - void testCurrent_data(); - void testCurrent(); - void testCurrentWithFollowsMouse_data(); - void testCurrentWithFollowsMouse(); + void testActiveOutputFollowsMouse_data(); + void testActiveOutputFollowsMouse(); void testCurrentPoint_data(); void testCurrentPoint(); }; @@ -92,30 +90,7 @@ void ScreensTest::cleanup() }); } -void ScreensTest::testCurrent_data() -{ - QTest::addColumn("currentId"); - - QTest::newRow("first") << 0; - QTest::newRow("second") << 1; -} - -void ScreensTest::testCurrent() -{ - QFETCH(int, currentId); - Output *output = workspace()->outputs().at(currentId); - - // Disable "active screen follows mouse" - auto group = kwinApp()->config()->group(QStringLiteral("Windows")); - group.writeEntry("ActiveMouseScreen", false); - group.sync(); - workspace()->slotReconfigure(); - - workspace()->setActiveOutput(output); - QCOMPARE(workspace()->activeOutput(), output); -} - -void ScreensTest::testCurrentWithFollowsMouse_data() +void ScreensTest::testActiveOutputFollowsMouse_data() { QTest::addColumn>("geometries"); QTest::addColumn("cursorPos"); @@ -127,12 +102,8 @@ void ScreensTest::testCurrentWithFollowsMouse_data() QTest::newRow("gap") << QList{{QRect{0, 0, 10, 20}, QRect{20, 40, 10, 20}}} << QPoint(15, 30) << 1; } -void ScreensTest::testCurrentWithFollowsMouse() +void ScreensTest::testActiveOutputFollowsMouse() { - // Enable "active screen follows mouse" - auto group = kwinApp()->config()->group(QStringLiteral("Windows")); - group.writeEntry("ActiveMouseScreen", true); - group.sync(); auto edgeBarrierGroup = kwinApp()->config()->group(QStringLiteral("EdgeBarrier")); edgeBarrierGroup.writeEntry("EdgeBarrier", 0); edgeBarrierGroup.writeEntry("CornerBarrier", false); diff --git a/src/main_x11.cpp b/src/main_x11.cpp index 473d77d3da..3506eb07ed 100644 --- a/src/main_x11.cpp +++ b/src/main_x11.cpp @@ -311,7 +311,7 @@ void ApplicationX11::performStartup() notifyKSplash(); notifyStarted(); - connect(Cursors::self()->mouse(), &Cursor::posChanged, this, qOverload(&Workspace::setActiveOutput)); + connect(Cursors::self()->mouse(), &Cursor::posChanged, workspace(), qOverload(&Workspace::setActiveOutput)); }); // we need to do an XSync here, otherwise the QPA might crash us later on Xcb::sync();