diff --git a/autotests/integration/activation_test.cpp b/autotests/integration/activation_test.cpp index deeb5a21ae..9deebf9fcd 100644 --- a/autotests/integration/activation_test.cpp +++ b/autotests/integration/activation_test.cpp @@ -10,6 +10,7 @@ #include "kwin_wayland_test.h" #include "abstract_client.h" +#include "abstract_output.h" #include "cursor.h" #include "platform.h" #include "screens.h" @@ -56,9 +57,10 @@ void ActivationTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/activities_test.cpp b/autotests/integration/activities_test.cpp index 0bc5cbcae7..1f258bf32a 100644 --- a/autotests/integration/activities_test.cpp +++ b/autotests/integration/activities_test.cpp @@ -7,6 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "kwin_wayland_test.h" +#include "abstract_output.h" #include "platform.h" #include "activities.h" #include "x11client.h" @@ -57,9 +58,10 @@ void ActivitiesTest::initTestCase() kwinApp()->setUseKActivities(true); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/debug_console_test.cpp b/autotests/integration/debug_console_test.cpp index 12de9e98e5..ad01149fa1 100644 --- a/autotests/integration/debug_console_test.cpp +++ b/autotests/integration/debug_console_test.cpp @@ -8,6 +8,7 @@ */ #include "kwin_wayland_test.h" #include "abstract_client.h" +#include "abstract_output.h" #include "debug_console.h" #include "internal_client.h" #include "platform.h" @@ -56,9 +57,10 @@ void DebugConsoleTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/decoration_input_test.cpp b/autotests/integration/decoration_input_test.cpp index d0a6eeadc7..d8c22d39a1 100644 --- a/autotests/integration/decoration_input_test.cpp +++ b/autotests/integration/decoration_input_test.cpp @@ -8,6 +8,7 @@ */ #include "kwin_wayland_test.h" #include "abstract_client.h" +#include "abstract_output.h" #include "cursor.h" #include "internal_client.h" #include "platform.h" @@ -137,9 +138,10 @@ void DecorationInputTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/desktop_window_x11_test.cpp b/autotests/integration/desktop_window_x11_test.cpp index 3bc0845a54..262ca8dae3 100644 --- a/autotests/integration/desktop_window_x11_test.cpp +++ b/autotests/integration/desktop_window_x11_test.cpp @@ -8,6 +8,7 @@ */ #include "kwin_wayland_test.h" #include "abstract_client.h" +#include "abstract_output.h" #include "platform.h" #include "x11client.h" #include "cursor.h" @@ -51,9 +52,10 @@ void X11DesktopWindowTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/dont_crash_aurorae_destroy_deco.cpp b/autotests/integration/dont_crash_aurorae_destroy_deco.cpp index bd00aeed98..e983070a3d 100644 --- a/autotests/integration/dont_crash_aurorae_destroy_deco.cpp +++ b/autotests/integration/dont_crash_aurorae_destroy_deco.cpp @@ -7,6 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "kwin_wayland_test.h" +#include "abstract_output.h" #include "platform.h" #include "x11client.h" #include "composite.h" @@ -58,9 +59,10 @@ void DontCrashAuroraeDestroyDecoTest::initTestCase() qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2")); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); Test::initWaylandWorkspace(); diff --git a/autotests/integration/dont_crash_empty_deco.cpp b/autotests/integration/dont_crash_empty_deco.cpp index 9baf2033b3..203fe13036 100644 --- a/autotests/integration/dont_crash_empty_deco.cpp +++ b/autotests/integration/dont_crash_empty_deco.cpp @@ -7,6 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "kwin_wayland_test.h" +#include "abstract_output.h" #include "platform.h" #include "x11client.h" #include "composite.h" @@ -49,9 +50,10 @@ void DontCrashEmptyDecorationTest::initTestCase() qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2")); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); Test::initWaylandWorkspace(); diff --git a/autotests/integration/dont_crash_no_border.cpp b/autotests/integration/dont_crash_no_border.cpp index 1465b3bdca..d5ae5ab198 100644 --- a/autotests/integration/dont_crash_no_border.cpp +++ b/autotests/integration/dont_crash_no_border.cpp @@ -8,6 +8,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "kwin_wayland_test.h" +#include "abstract_output.h" #include "platform.h" #include "x11client.h" #include "composite.h" @@ -59,9 +60,10 @@ void DontCrashNoBorder::initTestCase() qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2")); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); Test::initWaylandWorkspace(); diff --git a/autotests/integration/dont_crash_reinitialize_compositor.cpp b/autotests/integration/dont_crash_reinitialize_compositor.cpp index f530f94690..591ec157d4 100644 --- a/autotests/integration/dont_crash_reinitialize_compositor.cpp +++ b/autotests/integration/dont_crash_reinitialize_compositor.cpp @@ -10,6 +10,7 @@ #include "kwin_wayland_test.h" #include "abstract_client.h" +#include "abstract_output.h" #include "composite.h" #include "deleted.h" #include "effectloader.h" @@ -68,9 +69,10 @@ void DontCrashReinitializeCompositorTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); Test::initWaylandWorkspace(); auto scene = KWin::Compositor::self()->scene(); diff --git a/autotests/integration/dont_crash_useractions_menu.cpp b/autotests/integration/dont_crash_useractions_menu.cpp index 809ae0ea50..b21d21163f 100644 --- a/autotests/integration/dont_crash_useractions_menu.cpp +++ b/autotests/integration/dont_crash_useractions_menu.cpp @@ -8,6 +8,7 @@ */ #include "kwin_wayland_test.h" #include "abstract_client.h" +#include "abstract_output.h" #include "cursor.h" #include "keyboard_input.h" #include "platform.h" @@ -57,9 +58,10 @@ void TestDontCrashUseractionsMenu::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/input_stacking_order.cpp b/autotests/integration/input_stacking_order.cpp index 473c676311..e219540956 100644 --- a/autotests/integration/input_stacking_order.cpp +++ b/autotests/integration/input_stacking_order.cpp @@ -7,6 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "kwin_wayland_test.h" +#include "abstract_output.h" #include "platform.h" #include "abstract_client.h" #include "cursor.h" @@ -58,9 +59,10 @@ void InputStackingOrderTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/inputmethod_test.cpp b/autotests/integration/inputmethod_test.cpp index cd7c5c1c32..1ea0ee815c 100644 --- a/autotests/integration/inputmethod_test.cpp +++ b/autotests/integration/inputmethod_test.cpp @@ -8,6 +8,7 @@ */ #include "kwin_wayland_test.h" #include "abstract_client.h" +#include "abstract_output.h" #include "cursor.h" #include "effects.h" #include "deleted.h" @@ -76,9 +77,10 @@ void InputMethodTest::initTestCase() static_cast(kwinApp())->setInputMethodServerToStart("internal"); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/internal_window.cpp b/autotests/integration/internal_window.cpp index c1a91b06a2..e1dfb39e94 100644 --- a/autotests/integration/internal_window.cpp +++ b/autotests/integration/internal_window.cpp @@ -7,6 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "kwin_wayland_test.h" +#include "abstract_output.h" #include "platform.h" #include "cursor.h" #include "deleted.h" @@ -186,9 +187,10 @@ void InternalWindowTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/layershellv1client_test.cpp b/autotests/integration/layershellv1client_test.cpp index 31ed156bce..5545a5ad2c 100644 --- a/autotests/integration/layershellv1client_test.cpp +++ b/autotests/integration/layershellv1client_test.cpp @@ -61,9 +61,10 @@ void LayerShellV1ClientTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/lockscreen.cpp b/autotests/integration/lockscreen.cpp index 7b2a189875..86ae7547c8 100644 --- a/autotests/integration/lockscreen.cpp +++ b/autotests/integration/lockscreen.cpp @@ -7,6 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "kwin_wayland_test.h" +#include "abstract_output.h" #include "platform.h" #include "abstract_client.h" #include "composite.h" @@ -182,9 +183,10 @@ void LockScreenTest::initTestCase() qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2")); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); Test::initWaylandWorkspace(); diff --git a/autotests/integration/maximize_test.cpp b/autotests/integration/maximize_test.cpp index 707f24f449..cb24b654c5 100644 --- a/autotests/integration/maximize_test.cpp +++ b/autotests/integration/maximize_test.cpp @@ -8,6 +8,7 @@ */ #include "kwin_wayland_test.h" #include "abstract_client.h" +#include "abstract_output.h" #include "cursor.h" #include "decorations/decorationbridge.h" #include "decorations/settings.h" @@ -58,9 +59,10 @@ void TestMaximized::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/move_resize_window_test.cpp b/autotests/integration/move_resize_window_test.cpp index f1d13aad81..5d42a19370 100644 --- a/autotests/integration/move_resize_window_test.cpp +++ b/autotests/integration/move_resize_window_test.cpp @@ -8,6 +8,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "kwin_wayland_test.h" +#include "abstract_output.h" #include "atoms.h" #include "platform.h" #include "abstract_client.h" @@ -86,8 +87,9 @@ void MoveResizeWindowTest::initTestCase() QVERIFY(waylandServer()->init(s_socketName)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 1); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); } void MoveResizeWindowTest::init() diff --git a/autotests/integration/outputmanagement_test.cpp b/autotests/integration/outputmanagement_test.cpp index cbe29cf866..3808641680 100644 --- a/autotests/integration/outputmanagement_test.cpp +++ b/autotests/integration/outputmanagement_test.cpp @@ -66,9 +66,10 @@ void TestOutputManagement::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/placement_test.cpp b/autotests/integration/placement_test.cpp index 740cca07c5..b1a2c7c64a 100644 --- a/autotests/integration/placement_test.cpp +++ b/autotests/integration/placement_test.cpp @@ -8,6 +8,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "abstract_client.h" +#include "abstract_output.h" #include "cursor.h" #include "kwin_wayland_test.h" #include "platform.h" @@ -87,9 +88,10 @@ void TestPlacement::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/plasma_surface_test.cpp b/autotests/integration/plasma_surface_test.cpp index a95926d42b..724ff2518c 100644 --- a/autotests/integration/plasma_surface_test.cpp +++ b/autotests/integration/plasma_surface_test.cpp @@ -8,6 +8,7 @@ */ #include "kwin_wayland_test.h" #include "abstract_client.h" +#include "abstract_output.h" #include "platform.h" #include "cursor.h" #include "screens.h" @@ -201,9 +202,10 @@ void PlasmaSurfaceTest::testOSDPlacement() Q_ARG(QVector, geometries)); QVERIFY(screensChangedSpy.wait()); QCOMPARE(screensChangedSpy.count(), 2); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), geometries.at(0)); - QCOMPARE(screens()->geometry(1), geometries.at(1)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), geometries[0]); + QCOMPARE(outputs[1]->geometry(), geometries[1]); QCOMPARE(c->frameGeometry(), QRect(1280 / 2 - 100 / 2, 2 * 1024 / 3 - 50 / 2, 100, 50)); diff --git a/autotests/integration/plasmawindow_test.cpp b/autotests/integration/plasmawindow_test.cpp index 1878f88da2..8ecff0d7d4 100644 --- a/autotests/integration/plasmawindow_test.cpp +++ b/autotests/integration/plasmawindow_test.cpp @@ -7,6 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "kwin_wayland_test.h" +#include "abstract_output.h" #include "platform.h" #include "x11client.h" #include "cursor.h" @@ -65,9 +66,10 @@ void PlasmaWindowTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); setenv("QMLSCENE_DEVICE", "softwarecontext", true); Test::initWaylandWorkspace(); diff --git a/autotests/integration/pointer_constraints_test.cpp b/autotests/integration/pointer_constraints_test.cpp index e51da8160c..00d5e02042 100644 --- a/autotests/integration/pointer_constraints_test.cpp +++ b/autotests/integration/pointer_constraints_test.cpp @@ -8,6 +8,7 @@ */ #include "kwin_wayland_test.h" #include "abstract_client.h" +#include "abstract_output.h" #include "cursor.h" #include "keyboard_input.h" #include "platform.h" @@ -74,9 +75,10 @@ void TestPointerConstraints::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/pointer_input.cpp b/autotests/integration/pointer_input.cpp index 7b1f1efc39..149ffb36d7 100644 --- a/autotests/integration/pointer_input.cpp +++ b/autotests/integration/pointer_input.cpp @@ -7,6 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "kwin_wayland_test.h" +#include "abstract_output.h" #include "platform.h" #include "abstract_client.h" #include "cursor.h" @@ -151,9 +152,10 @@ void PointerInputTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/quick_tiling_test.cpp b/autotests/integration/quick_tiling_test.cpp index 08ae2a2213..9ee3bc4340 100644 --- a/autotests/integration/quick_tiling_test.cpp +++ b/autotests/integration/quick_tiling_test.cpp @@ -7,6 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "kwin_wayland_test.h" +#include "abstract_output.h" #include "platform.h" #include "abstract_client.h" #include "x11client.h" @@ -99,9 +100,11 @@ void QuickTilingTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); } void QuickTilingTest::init() diff --git a/autotests/integration/screen_changes_test.cpp b/autotests/integration/screen_changes_test.cpp index 155d0a5243..8ac6463c71 100644 --- a/autotests/integration/screen_changes_test.cpp +++ b/autotests/integration/screen_changes_test.cpp @@ -7,6 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "kwin_wayland_test.h" +#include "abstract_output.h" #include "cursor.h" #include "platform.h" #include "screens.h" @@ -95,9 +96,10 @@ void ScreenChangesTest::testScreenAddRemove() Q_ARG(QVector, geometries)); QVERIFY(screensChangedSpy.wait()); QCOMPARE(screensChangedSpy.count(), 2); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), geometries.at(0)); - QCOMPARE(screens()->geometry(1), geometries.at(1)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), geometries[0]); + QCOMPARE(outputs[1]->geometry(), geometries[1]); // this should result in it getting announced, two new outputs are added... QVERIFY(outputAnnouncedSpy.wait()); diff --git a/autotests/integration/screenedge_client_show_test.cpp b/autotests/integration/screenedge_client_show_test.cpp index e50739dbff..38cf15ca29 100644 --- a/autotests/integration/screenedge_client_show_test.cpp +++ b/autotests/integration/screenedge_client_show_test.cpp @@ -7,6 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "kwin_wayland_test.h" +#include "abstract_output.h" #include "platform.h" #include "x11client.h" #include "cursor.h" @@ -57,9 +58,10 @@ void ScreenEdgeClientShowTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/screens_test.cpp b/autotests/integration/screens_test.cpp index abbe5c9c90..757e3837ab 100644 --- a/autotests/integration/screens_test.cpp +++ b/autotests/integration/screens_test.cpp @@ -8,6 +8,7 @@ */ #include "kwin_wayland_test.h" #include "abstract_client.h" +#include "abstract_output.h" #include "cursor.h" #include "platform.h" #include "screens.h" @@ -56,9 +57,10 @@ void ScreensTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/scripting/minimizeall_test.cpp b/autotests/integration/scripting/minimizeall_test.cpp index d0f32e549c..109f1820e0 100644 --- a/autotests/integration/scripting/minimizeall_test.cpp +++ b/autotests/integration/scripting/minimizeall_test.cpp @@ -10,6 +10,7 @@ #include "kwin_wayland_test.h" #include "abstract_client.h" +#include "abstract_output.h" #include "platform.h" #include "screens.h" #include "scripting/scripting.h" @@ -53,9 +54,10 @@ void MinimizeAllScriptTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/shade_test.cpp b/autotests/integration/shade_test.cpp index 5619f154d5..a85a420ad2 100644 --- a/autotests/integration/shade_test.cpp +++ b/autotests/integration/shade_test.cpp @@ -7,6 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "kwin_wayland_test.h" +#include "abstract_output.h" #include "platform.h" #include "x11client.h" #include "cursor.h" @@ -46,9 +47,10 @@ void ShadeTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/struts_test.cpp b/autotests/integration/struts_test.cpp index ec398d826d..d48b6f2711 100644 --- a/autotests/integration/struts_test.cpp +++ b/autotests/integration/struts_test.cpp @@ -75,9 +75,10 @@ void StrutsTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); Test::initWaylandWorkspace(); } @@ -692,12 +693,13 @@ void StrutsTest::test363804() Qt::DirectConnection, Q_ARG(int, 2), Q_ARG(QVector, geometries)); - QCOMPARE(screens()->geometry(0), geometries.at(0)); - QCOMPARE(screens()->geometry(1), geometries.at(1)); QCOMPARE(screens()->geometry(), QRect(0, 0, 1920, 1848)); VirtualDesktop *desktop = VirtualDesktopManager::self()->currentDesktop(); const QVector outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), geometries[0]); + QCOMPARE(outputs[1]->geometry(), geometries[1]); // create an xcb window QScopedPointer c(xcb_connect(nullptr, nullptr)); diff --git a/autotests/integration/touch_input_test.cpp b/autotests/integration/touch_input_test.cpp index 4cf33407a6..bb911810ec 100644 --- a/autotests/integration/touch_input_test.cpp +++ b/autotests/integration/touch_input_test.cpp @@ -8,6 +8,7 @@ */ #include "kwin_wayland_test.h" #include "abstract_client.h" +#include "abstract_output.h" #include "platform.h" #include "cursor.h" #include "screens.h" @@ -56,9 +57,10 @@ void TouchInputTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/transient_placement.cpp b/autotests/integration/transient_placement.cpp index a807221380..0ea26da9f4 100644 --- a/autotests/integration/transient_placement.cpp +++ b/autotests/integration/transient_placement.cpp @@ -7,6 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "kwin_wayland_test.h" +#include "abstract_output.h" #include "platform.h" #include "abstract_client.h" #include "cursor.h" @@ -69,9 +70,10 @@ void TransientPlacementTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/window_rules_test.cpp b/autotests/integration/window_rules_test.cpp index c425a0fd00..251b039ac6 100644 --- a/autotests/integration/window_rules_test.cpp +++ b/autotests/integration/window_rules_test.cpp @@ -7,6 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "kwin_wayland_test.h" +#include "abstract_output.h" #include "platform.h" #include "atoms.h" #include "x11client.h" @@ -50,9 +51,10 @@ void WindowRuleTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/window_selection_test.cpp b/autotests/integration/window_selection_test.cpp index d9d508472b..a1fdd7d087 100644 --- a/autotests/integration/window_selection_test.cpp +++ b/autotests/integration/window_selection_test.cpp @@ -8,6 +8,7 @@ */ #include "kwin_wayland_test.h" #include "abstract_client.h" +#include "abstract_output.h" #include "cursor.h" #include "keyboard_input.h" #include "platform.h" @@ -62,9 +63,10 @@ void TestWindowSelection::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/xdgshellclient_rules_test.cpp b/autotests/integration/xdgshellclient_rules_test.cpp index 32d2b1e995..9a3992a807 100644 --- a/autotests/integration/xdgshellclient_rules_test.cpp +++ b/autotests/integration/xdgshellclient_rules_test.cpp @@ -11,6 +11,7 @@ #include "kwin_wayland_test.h" #include "abstract_client.h" +#include "abstract_output.h" #include "cursor.h" #include "platform.h" #include "rules.h" @@ -144,9 +145,10 @@ void TestXdgShellClientRules::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/xdgshellclient_test.cpp b/autotests/integration/xdgshellclient_test.cpp index 7a327ae53a..66093b4c72 100644 --- a/autotests/integration/xdgshellclient_test.cpp +++ b/autotests/integration/xdgshellclient_test.cpp @@ -179,9 +179,10 @@ void TestXdgShellClient::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/xwayland_input_test.cpp b/autotests/integration/xwayland_input_test.cpp index d752a791be..547e31062c 100644 --- a/autotests/integration/xwayland_input_test.cpp +++ b/autotests/integration/xwayland_input_test.cpp @@ -7,6 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "kwin_wayland_test.h" +#include "abstract_output.h" #include "platform.h" #include "x11client.h" #include "cursor.h" @@ -50,9 +51,10 @@ void XWaylandInputTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); Test::initWaylandWorkspace(); } diff --git a/autotests/integration/xwayland_selections_test.cpp b/autotests/integration/xwayland_selections_test.cpp index 6440db0f2a..5da6d1e52a 100644 --- a/autotests/integration/xwayland_selections_test.cpp +++ b/autotests/integration/xwayland_selections_test.cpp @@ -9,6 +9,7 @@ */ #include "kwin_wayland_test.h" #include "abstract_client.h" +#include "abstract_output.h" #include "platform.h" #include "screens.h" #include "wayland_server.h" @@ -53,9 +54,10 @@ void XwaylandSelectionsTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); Test::initWaylandWorkspace(); // // wait till the xclipboard sync data device is created // if (clipboardSyncDevicedCreated.empty()) { diff --git a/autotests/integration/xwaylandserver_crash_test.cpp b/autotests/integration/xwaylandserver_crash_test.cpp index 1a39a6724d..0922a6936c 100644 --- a/autotests/integration/xwaylandserver_crash_test.cpp +++ b/autotests/integration/xwaylandserver_crash_test.cpp @@ -5,6 +5,7 @@ */ #include "kwin_wayland_test.h" +#include "abstract_output.h" #include "composite.h" #include "main.h" #include "platform.h" @@ -58,9 +59,10 @@ void XwaylandServerCrashTest::initTestCase() kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); - QCOMPARE(screens()->count(), 2); - QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); - QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + const auto outputs = kwinApp()->platform()->enabledOutputs(); + QCOMPARE(outputs.count(), 2); + QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024)); Test::initWaylandWorkspace(); }