diff --git a/autotests/integration/activation_test.cpp b/autotests/integration/activation_test.cpp index f43df92bdb..949c100fa9 100644 --- a/autotests/integration/activation_test.cpp +++ b/autotests/integration/activation_test.cpp @@ -10,7 +10,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "wayland_server.h" #include "window.h" @@ -49,9 +49,9 @@ void ActivationTest::initTestCase() qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); @@ -521,7 +521,7 @@ void ActivationTest::stackScreensHorizontally() 1, }; - QMetaObject::invokeMethod(kwinApp()->platform(), + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, screenGeometries.count()), @@ -544,7 +544,7 @@ void ActivationTest::stackScreensVertically() 1, }; - QMetaObject::invokeMethod(kwinApp()->platform(), + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, screenGeometries.count()), diff --git a/autotests/integration/activities_test.cpp b/autotests/integration/activities_test.cpp index 427db4ec18..f8df5b62a7 100644 --- a/autotests/integration/activities_test.cpp +++ b/autotests/integration/activities_test.cpp @@ -10,7 +10,7 @@ #include "activities.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "deleted.h" #include "utils/xcbutils.h" @@ -49,9 +49,9 @@ void ActivitiesTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->setUseKActivities(true); kwinApp()->start(); diff --git a/autotests/integration/dbus_interface_test.cpp b/autotests/integration/dbus_interface_test.cpp index e37fbabef4..9ae6ca9966 100644 --- a/autotests/integration/dbus_interface_test.cpp +++ b/autotests/integration/dbus_interface_test.cpp @@ -11,7 +11,7 @@ #include "kwin_wayland_test.h" #include "atoms.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "deleted.h" #include "rules.h" #include "virtualdesktops.h" @@ -58,7 +58,7 @@ void TestDbusInterface::initTestCase() qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); kwinApp()->start(); diff --git a/autotests/integration/debug_console_test.cpp b/autotests/integration/debug_console_test.cpp index 2a47828fa2..5048a259d3 100644 --- a/autotests/integration/debug_console_test.cpp +++ b/autotests/integration/debug_console_test.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "debug_console.h" #include "internalwindow.h" #include "utils/xcbutils.h" @@ -50,9 +50,9 @@ void DebugConsoleTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); diff --git a/autotests/integration/decoration_input_test.cpp b/autotests/integration/decoration_input_test.cpp index f9b801a50f..0a923777a0 100644 --- a/autotests/integration/decoration_input_test.cpp +++ b/autotests/integration/decoration_input_test.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "internalwindow.h" #include "pointer_input.h" @@ -121,9 +121,9 @@ void DecorationInputTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); // change some options KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); diff --git a/autotests/integration/desktop_window_x11_test.cpp b/autotests/integration/desktop_window_x11_test.cpp index 356acb282c..c631605e96 100644 --- a/autotests/integration/desktop_window_x11_test.cpp +++ b/autotests/integration/desktop_window_x11_test.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "deleted.h" #include "utils/xcbutils.h" @@ -44,9 +44,9 @@ void X11DesktopWindowTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); diff --git a/autotests/integration/dont_crash_aurorae_destroy_deco.cpp b/autotests/integration/dont_crash_aurorae_destroy_deco.cpp index b390eae69f..32e4828d11 100644 --- a/autotests/integration/dont_crash_aurorae_destroy_deco.cpp +++ b/autotests/integration/dont_crash_aurorae_destroy_deco.cpp @@ -10,7 +10,7 @@ #include "composite.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "core/renderbackend.h" #include "cursor.h" #include "wayland_server.h" @@ -43,9 +43,9 @@ void DontCrashAuroraeDestroyDecoTest::initTestCase() qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); config->group("org.kde.kdecoration2").writeEntry("library", "org.kde.kwin.aurorae"); diff --git a/autotests/integration/dont_crash_cancel_animation.cpp b/autotests/integration/dont_crash_cancel_animation.cpp index 94a0320b6c..2ddce0680c 100644 --- a/autotests/integration/dont_crash_cancel_animation.cpp +++ b/autotests/integration/dont_crash_cancel_animation.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "composite.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "deleted.h" #include "effectloader.h" #include "effects.h" @@ -45,7 +45,7 @@ void DontCrashCancelAnimationFromAnimationEndedTest::initTestCase() { qRegisterMetaType(); qRegisterMetaType(); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); kwinApp()->start(); QVERIFY(Compositor::self()); diff --git a/autotests/integration/dont_crash_empty_deco.cpp b/autotests/integration/dont_crash_empty_deco.cpp index 683b9fa15c..e7d35bc141 100644 --- a/autotests/integration/dont_crash_empty_deco.cpp +++ b/autotests/integration/dont_crash_empty_deco.cpp @@ -10,7 +10,7 @@ #include "composite.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "core/renderbackend.h" #include "cursor.h" #include "wayland_server.h" @@ -40,9 +40,9 @@ void DontCrashEmptyDecorationTest::initTestCase() { qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); // this test needs to enforce OpenGL compositing to get into the crashy condition qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2")); diff --git a/autotests/integration/dont_crash_glxgears.cpp b/autotests/integration/dont_crash_glxgears.cpp index 285cc57c8b..1865237e19 100644 --- a/autotests/integration/dont_crash_glxgears.cpp +++ b/autotests/integration/dont_crash_glxgears.cpp @@ -8,7 +8,7 @@ */ #include "kwin_wayland_test.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "deleted.h" #include "wayland_server.h" #include "window.h" @@ -34,7 +34,7 @@ void DontCrashGlxgearsTest::initTestCase() { qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); diff --git a/autotests/integration/dont_crash_no_border.cpp b/autotests/integration/dont_crash_no_border.cpp index c6c2cbddd3..ec8399a2f5 100644 --- a/autotests/integration/dont_crash_no_border.cpp +++ b/autotests/integration/dont_crash_no_border.cpp @@ -11,7 +11,7 @@ #include "composite.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "core/renderbackend.h" #include "cursor.h" #include "wayland_server.h" @@ -44,9 +44,9 @@ void DontCrashNoBorder::initTestCase() { qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); config->group("org.kde.kdecoration2").writeEntry("NoPlugin", true); diff --git a/autotests/integration/dont_crash_reinitialize_compositor.cpp b/autotests/integration/dont_crash_reinitialize_compositor.cpp index 5643ef1ec2..e3a3422bac 100644 --- a/autotests/integration/dont_crash_reinitialize_compositor.cpp +++ b/autotests/integration/dont_crash_reinitialize_compositor.cpp @@ -11,7 +11,7 @@ #include "composite.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "core/renderbackend.h" #include "deleted.h" #include "effectloader.h" @@ -47,9 +47,9 @@ void DontCrashReinitializeCompositorTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); KConfigGroup plugins(config, QStringLiteral("Plugins")); diff --git a/autotests/integration/dont_crash_useractions_menu.cpp b/autotests/integration/dont_crash_useractions_menu.cpp index 0c2e5c8931..82130e9167 100644 --- a/autotests/integration/dont_crash_useractions_menu.cpp +++ b/autotests/integration/dont_crash_useractions_menu.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "keyboard_input.h" #include "pointer_input.h" @@ -47,9 +47,9 @@ void TestDontCrashUseractionsMenu::initTestCase() { qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); // force style to breeze as that's the one which triggered the crash QVERIFY(kwinApp()->setStyle(QStringLiteral("breeze"))); diff --git a/autotests/integration/effects/desktop_switching_animation_test.cpp b/autotests/integration/effects/desktop_switching_animation_test.cpp index 08a0f85f87..d65917d566 100644 --- a/autotests/integration/effects/desktop_switching_animation_test.cpp +++ b/autotests/integration/effects/desktop_switching_animation_test.cpp @@ -10,7 +10,7 @@ #include "kwin_wayland_test.h" #include "composite.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "core/renderbackend.h" #include "effectloader.h" #include "effects.h" @@ -44,9 +44,9 @@ void DesktopSwitchingAnimationTest::initTestCase() qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); KConfigGroup plugins(config, QStringLiteral("Plugins")); diff --git a/autotests/integration/effects/maximize_animation_test.cpp b/autotests/integration/effects/maximize_animation_test.cpp index df2f186585..3336d7e7f2 100644 --- a/autotests/integration/effects/maximize_animation_test.cpp +++ b/autotests/integration/effects/maximize_animation_test.cpp @@ -10,7 +10,7 @@ #include "kwin_wayland_test.h" #include "composite.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "effectloader.h" #include "effects.h" #include "scene.h" @@ -42,9 +42,9 @@ void MaximizeAnimationTest::initTestCase() qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); KConfigGroup plugins(config, QStringLiteral("Plugins")); diff --git a/autotests/integration/effects/minimize_animation_test.cpp b/autotests/integration/effects/minimize_animation_test.cpp index 0ef796e0d6..6bd564499d 100644 --- a/autotests/integration/effects/minimize_animation_test.cpp +++ b/autotests/integration/effects/minimize_animation_test.cpp @@ -10,7 +10,7 @@ #include "kwin_wayland_test.h" #include "composite.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "core/renderbackend.h" #include "effectloader.h" #include "effects.h" @@ -45,9 +45,9 @@ void MinimizeAnimationTest::initTestCase() qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); KConfigGroup plugins(config, QStringLiteral("Plugins")); diff --git a/autotests/integration/effects/popup_open_close_animation_test.cpp b/autotests/integration/effects/popup_open_close_animation_test.cpp index a4b7c8005b..872a2ee38c 100644 --- a/autotests/integration/effects/popup_open_close_animation_test.cpp +++ b/autotests/integration/effects/popup_open_close_animation_test.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "deleted.h" #include "effectloader.h" #include "effects.h" @@ -51,9 +51,9 @@ void PopupOpenCloseAnimationTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); KConfigGroup plugins(config, QStringLiteral("Plugins")); diff --git a/autotests/integration/effects/scripted_effects_test.cpp b/autotests/integration/effects/scripted_effects_test.cpp index 502082439f..8bea912c4f 100644 --- a/autotests/integration/effects/scripted_effects_test.cpp +++ b/autotests/integration/effects/scripted_effects_test.cpp @@ -10,7 +10,7 @@ #include "kwin_wayland_test.h" #include "composite.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "core/renderbackend.h" #include "cursor.h" #include "deleted.h" @@ -130,9 +130,9 @@ void ScriptedEffectsTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 1)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 1)); // disable all effects - we don't want to have it interact with the rendering auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); diff --git a/autotests/integration/effects/slidingpopups_test.cpp b/autotests/integration/effects/slidingpopups_test.cpp index b30532ec9f..0719b8b9e4 100644 --- a/autotests/integration/effects/slidingpopups_test.cpp +++ b/autotests/integration/effects/slidingpopups_test.cpp @@ -7,7 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "composite.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "core/renderbackend.h" #include "cursor.h" #include "deleted.h" @@ -52,9 +52,9 @@ void SlidingPopupsTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); // disable all effects - we don't want to have it interact with the rendering auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); diff --git a/autotests/integration/effects/toplevel_open_close_animation_test.cpp b/autotests/integration/effects/toplevel_open_close_animation_test.cpp index 1fa6685cf5..b91e44b257 100644 --- a/autotests/integration/effects/toplevel_open_close_animation_test.cpp +++ b/autotests/integration/effects/toplevel_open_close_animation_test.cpp @@ -10,7 +10,7 @@ #include "kwin_wayland_test.h" #include "composite.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "core/renderbackend.h" #include "deleted.h" #include "effectloader.h" @@ -47,9 +47,9 @@ void ToplevelOpenCloseAnimationTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); KConfigGroup plugins(config, QStringLiteral("Plugins")); diff --git a/autotests/integration/effects/translucency_test.cpp b/autotests/integration/effects/translucency_test.cpp index a933c3a009..195e320d15 100644 --- a/autotests/integration/effects/translucency_test.cpp +++ b/autotests/integration/effects/translucency_test.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "composite.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "effectloader.h" #include "effects.h" @@ -46,9 +46,9 @@ void TranslucencyTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); // disable all effects - we don't want to have it interact with the rendering auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); diff --git a/autotests/integration/effects/wobbly_shade_test.cpp b/autotests/integration/effects/wobbly_shade_test.cpp index e86c9dd024..214a0bfd8c 100644 --- a/autotests/integration/effects/wobbly_shade_test.cpp +++ b/autotests/integration/effects/wobbly_shade_test.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "composite.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "core/renderbackend.h" #include "cursor.h" #include "effectloader.h" @@ -47,9 +47,9 @@ void WobblyWindowsShadeTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); // disable all effects - we don't want to have it interact with the rendering auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); diff --git a/autotests/integration/generic_scene_opengl_test.cpp b/autotests/integration/generic_scene_opengl_test.cpp index f89a6560a2..6029c176a6 100644 --- a/autotests/integration/generic_scene_opengl_test.cpp +++ b/autotests/integration/generic_scene_opengl_test.cpp @@ -8,7 +8,7 @@ */ #include "generic_scene_opengl_test.h" #include "composite.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "core/renderbackend.h" #include "cursor.h" #include "effectloader.h" @@ -40,9 +40,9 @@ void GenericSceneOpenGLTest::initTestCase() { qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); // disable all effects - we don't want to have it interact with the rendering auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); diff --git a/autotests/integration/globalshortcuts_test.cpp b/autotests/integration/globalshortcuts_test.cpp index cf5f013edc..b56c35c898 100644 --- a/autotests/integration/globalshortcuts_test.cpp +++ b/autotests/integration/globalshortcuts_test.cpp @@ -8,7 +8,7 @@ */ #include "kwin_wayland_test.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "input.h" #include "internalwindow.h" @@ -60,9 +60,9 @@ void GlobalShortcutsTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig)); qputenv("KWIN_XKB_DEFAULT_KEYMAP", "1"); diff --git a/autotests/integration/idle_inhibition_test.cpp b/autotests/integration/idle_inhibition_test.cpp index c21492e171..c04e1f706b 100644 --- a/autotests/integration/idle_inhibition_test.cpp +++ b/autotests/integration/idle_inhibition_test.cpp @@ -8,7 +8,7 @@ */ #include "kwin_wayland_test.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "virtualdesktops.h" #include "wayland_server.h" #include "window.h" @@ -40,9 +40,9 @@ void TestIdleInhibition::initTestCase() qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); diff --git a/autotests/integration/input_stacking_order.cpp b/autotests/integration/input_stacking_order.cpp index 7b5e31f0fd..b535ccfde0 100644 --- a/autotests/integration/input_stacking_order.cpp +++ b/autotests/integration/input_stacking_order.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "deleted.h" #include "wayland/seat_interface.h" @@ -50,9 +50,9 @@ void InputStackingOrderTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); diff --git a/autotests/integration/inputmethod_test.cpp b/autotests/integration/inputmethod_test.cpp index 73f157bc9b..92c4a6e4da 100644 --- a/autotests/integration/inputmethod_test.cpp +++ b/autotests/integration/inputmethod_test.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "deleted.h" #include "effects.h" @@ -84,9 +84,9 @@ void InputMethodTest::initTestCase() qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); static_cast(kwinApp())->setInputMethodServerToStart("internal"); kwinApp()->start(); diff --git a/autotests/integration/internal_window.cpp b/autotests/integration/internal_window.cpp index 5a3ecd3029..687dc85af4 100644 --- a/autotests/integration/internal_window.cpp +++ b/autotests/integration/internal_window.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "deleted.h" #include "effects.h" @@ -174,9 +174,9 @@ void InternalWindowTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig)); kwinApp()->start(); @@ -637,7 +637,7 @@ void InternalWindowTest::testPopup() void InternalWindowTest::testScale() { - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2), Q_ARG(QVector, QVector({QRect(0, 0, 1280, 1024), QRect(1280 / 2, 0, 1280, 1024)})), Q_ARG(QVector, QVector({2, 2}))); diff --git a/autotests/integration/keyboard_layout_test.cpp b/autotests/integration/keyboard_layout_test.cpp index b0a61708b4..bdc0509848 100644 --- a/autotests/integration/keyboard_layout_test.cpp +++ b/autotests/integration/keyboard_layout_test.cpp @@ -8,7 +8,7 @@ */ #include "kwin_wayland_test.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "keyboard_input.h" #include "keyboard_layout.h" #include "virtualdesktops.h" @@ -132,9 +132,9 @@ void KeyboardLayoutTest::initTestCase() { qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig)); kwinApp()->setKxkbConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig)); diff --git a/autotests/integration/keymap_creation_failure_test.cpp b/autotests/integration/keymap_creation_failure_test.cpp index 84b593b421..5709b74cc1 100644 --- a/autotests/integration/keymap_creation_failure_test.cpp +++ b/autotests/integration/keymap_creation_failure_test.cpp @@ -8,7 +8,7 @@ */ #include "kwin_wayland_test.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "keyboard_input.h" #include "keyboard_layout.h" #include "virtualdesktops.h" @@ -48,7 +48,7 @@ void KeymapCreationFailureTest::initTestCase() qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig)); diff --git a/autotests/integration/kwin_wayland_test.cpp b/autotests/integration/kwin_wayland_test.cpp index 0f0e011e7c..e4be72498f 100644 --- a/autotests/integration/kwin_wayland_test.cpp +++ b/autotests/integration/kwin_wayland_test.cpp @@ -10,7 +10,7 @@ #include "backends/virtual/virtual_backend.h" #include "composite.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "core/session.h" #include "effects.h" #include "inputmethod.h" @@ -71,7 +71,7 @@ WaylandTestApplication::WaylandTestApplication(OperationMode mode, int &argc, ch addLibraryPath(ownPath); setSession(Session::create(Session::Type::Noop)); - setPlatform(std::make_unique()); + setOutputBackend(std::make_unique()); WaylandServer::create(this); setProcessStartupEnvironment(QProcessEnvironment::systemEnvironment()); } @@ -131,7 +131,7 @@ void WaylandTestApplication::performStartup() // first load options - done internally by a different thread createOptions(); - if (!platform()->initialize()) { + if (!outputBackend()->initialize()) { std::exit(1); } diff --git a/autotests/integration/kwinbindings_test.cpp b/autotests/integration/kwinbindings_test.cpp index b46fab4afb..20968452c4 100644 --- a/autotests/integration/kwinbindings_test.cpp +++ b/autotests/integration/kwinbindings_test.cpp @@ -8,7 +8,7 @@ */ #include "kwin_wayland_test.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "input.h" #include "scripting/scripting.h" @@ -46,7 +46,7 @@ void KWinBindingsTest::initTestCase() { qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig)); diff --git a/autotests/integration/layershellv1window_test.cpp b/autotests/integration/layershellv1window_test.cpp index eff5b01968..ac6318927e 100644 --- a/autotests/integration/layershellv1window_test.cpp +++ b/autotests/integration/layershellv1window_test.cpp @@ -7,7 +7,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "main.h" #include "wayland_server.h" #include "window.h" @@ -54,9 +54,9 @@ private Q_SLOTS: void LayerShellV1WindowTest::initTestCase() { QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); diff --git a/autotests/integration/lockscreen.cpp b/autotests/integration/lockscreen.cpp index 46ba156252..c27b589ff7 100644 --- a/autotests/integration/lockscreen.cpp +++ b/autotests/integration/lockscreen.cpp @@ -10,7 +10,7 @@ #include "composite.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "core/renderbackend.h" #include "cursor.h" #include "screenedge.h" @@ -178,9 +178,9 @@ void LockScreenTest::initTestCase() qRegisterMetaType("ElectricBorder"); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2")); kwinApp()->start(); diff --git a/autotests/integration/maximize_test.cpp b/autotests/integration/maximize_test.cpp index 087044352d..cdbc503b17 100644 --- a/autotests/integration/maximize_test.cpp +++ b/autotests/integration/maximize_test.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "decorations/decorationbridge.h" #include "decorations/settings.h" @@ -48,9 +48,9 @@ void TestMaximized::initTestCase() { qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig)); diff --git a/autotests/integration/modifier_only_shortcut_test.cpp b/autotests/integration/modifier_only_shortcut_test.cpp index d3807ecdb3..30023b6c53 100644 --- a/autotests/integration/modifier_only_shortcut_test.cpp +++ b/autotests/integration/modifier_only_shortcut_test.cpp @@ -10,7 +10,7 @@ #include "kwin_wayland_test.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "input.h" #include "keyboard_input.h" @@ -82,7 +82,7 @@ void Target::shortcut() void ModifierOnlyShortcutTest::initTestCase() { QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig)); diff --git a/autotests/integration/move_resize_window_test.cpp b/autotests/integration/move_resize_window_test.cpp index 62169dd5b6..19cec522d5 100644 --- a/autotests/integration/move_resize_window_test.cpp +++ b/autotests/integration/move_resize_window_test.cpp @@ -11,7 +11,7 @@ #include "atoms.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "deleted.h" #include "effects.h" @@ -82,9 +82,9 @@ void MoveResizeWindowTest::initTestCase() qRegisterMetaType(); qRegisterMetaType("MaximizeMode"); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 1)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 1)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); const auto outputs = workspace()->outputs(); diff --git a/autotests/integration/nightcolor_test.cpp b/autotests/integration/nightcolor_test.cpp index d80a25c84f..271ba0fa43 100644 --- a/autotests/integration/nightcolor_test.cpp +++ b/autotests/integration/nightcolor_test.cpp @@ -8,7 +8,7 @@ */ #include "kwin_wayland_test.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "plugins/nightcolor/constants.h" #include "plugins/nightcolor/nightcolormanager.h" #include "wayland_server.h" @@ -34,9 +34,9 @@ private Q_SLOTS: void NightColorTest::initTestCase() { QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig)); diff --git a/autotests/integration/no_global_shortcuts_test.cpp b/autotests/integration/no_global_shortcuts_test.cpp index 291f32fef4..72c7710243 100644 --- a/autotests/integration/no_global_shortcuts_test.cpp +++ b/autotests/integration/no_global_shortcuts_test.cpp @@ -8,7 +8,7 @@ */ #include "kwin_wayland_test.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "input.h" #include "keyboard_input.h" @@ -90,7 +90,7 @@ void NoGlobalShortcutsTest::initTestCase() { qRegisterMetaType("ElectricBorder"); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName, KWin::WaylandServer::InitializationFlag::NoGlobalShortcuts)); kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig)); diff --git a/autotests/integration/outputchanges_test.cpp b/autotests/integration/outputchanges_test.cpp index 5fd65e44c3..d40f382f40 100644 --- a/autotests/integration/outputchanges_test.cpp +++ b/autotests/integration/outputchanges_test.cpp @@ -7,8 +7,8 @@ #include "kwin_wayland_test.h" #include "core/output.h" +#include "core/outputbackend.h" #include "core/outputconfiguration.h" -#include "core/platform.h" #include "cursor.h" #include "wayland_server.h" #include "window.h" @@ -50,9 +50,9 @@ void OutputChangesTest::initTestCase() qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); @@ -64,7 +64,7 @@ void OutputChangesTest::initTestCase() void OutputChangesTest::init() { - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); QVERIFY(Test::setupWaylandConnection()); workspace()->setActiveOutput(QPoint(640, 512)); @@ -78,7 +78,7 @@ void OutputChangesTest::cleanup() void OutputChangesTest::testWindowSticksToOutputAfterOutputIsDisabled() { - auto outputs = kwinApp()->platform()->outputs(); + auto outputs = kwinApp()->outputBackend()->outputs(); // Create a window. std::unique_ptr surface(Test::createSurface()); @@ -104,7 +104,7 @@ void OutputChangesTest::testWindowSticksToOutputAfterOutputIsDisabled() void OutputChangesTest::testWindowSticksToOutputAfterAnotherOutputIsDisabled() { - auto outputs = kwinApp()->platform()->outputs(); + auto outputs = kwinApp()->outputBackend()->outputs(); // Create a window. std::unique_ptr surface(Test::createSurface()); @@ -134,7 +134,7 @@ void OutputChangesTest::testWindowSticksToOutputAfterAnotherOutputIsDisabled() void OutputChangesTest::testWindowSticksToOutputAfterOutputIsMoved() { - auto outputs = kwinApp()->platform()->outputs(); + auto outputs = kwinApp()->outputBackend()->outputs(); // Create a window. std::unique_ptr surface(Test::createSurface()); @@ -163,7 +163,7 @@ void OutputChangesTest::testWindowSticksToOutputAfterOutputsAreSwappedLeftToRigh // This test verifies that a window placed on the left monitor sticks // to that monitor even after the monitors are swapped horizontally. - const auto outputs = kwinApp()->platform()->outputs(); + const auto outputs = kwinApp()->outputBackend()->outputs(); // Create a window. std::unique_ptr surface(Test::createSurface()); @@ -196,7 +196,7 @@ void OutputChangesTest::testWindowSticksToOutputAfterOutputsAreSwappedRightToLef // This test verifies that a window placed on the right monitor sticks // to that monitor even after the monitors are swapped horizontally. - const auto outputs = kwinApp()->platform()->outputs(); + const auto outputs = kwinApp()->outputBackend()->outputs(); // Create a window. std::unique_ptr surface(Test::createSurface()); @@ -228,7 +228,7 @@ void OutputChangesTest::testWindowRestoredAfterEnablingOutput() { // This test verifies that a window will be moved back to its original output when it's hotplugged. - const auto outputs = kwinApp()->platform()->outputs(); + const auto outputs = kwinApp()->outputBackend()->outputs(); // Create a window. std::unique_ptr surface(Test::createSurface()); @@ -271,7 +271,7 @@ void OutputChangesTest::testWindowNotRestoredAfterMovingWindowAndEnablingOutput( // This test verifies that a window won't be moved to its original output when it's // hotplugged because the window was moved manually by the user. - const auto outputs = kwinApp()->platform()->outputs(); + const auto outputs = kwinApp()->outputBackend()->outputs(); // Create a window. std::unique_ptr surface(Test::createSurface()); @@ -321,7 +321,7 @@ void OutputChangesTest::testMaximizedWindowRestoredAfterEnablingOutput() // This test verifies that a maximized window will be moved to its original // output when it's re-enabled. - const auto outputs = kwinApp()->platform()->outputs(); + const auto outputs = kwinApp()->outputBackend()->outputs(); // Create a window. std::unique_ptr surface(Test::createSurface()); @@ -388,7 +388,7 @@ void OutputChangesTest::testFullScreenWindowRestoredAfterEnablingOutput() // This test verifies that a fullscreen window will be moved to its original // output when it's re-enabled. - const auto outputs = kwinApp()->platform()->outputs(); + const auto outputs = kwinApp()->outputBackend()->outputs(); // Create a window. std::unique_ptr surface(Test::createSurface()); @@ -454,7 +454,7 @@ void OutputChangesTest::testWindowRestoredAfterChangingScale() { // This test verifies that a window will be moved to its original position after changing the scale of an output - const auto output = kwinApp()->platform()->outputs().front(); + const auto output = kwinApp()->outputBackend()->outputs().front(); // Create a window. std::unique_ptr surface(Test::createSurface()); @@ -498,7 +498,7 @@ void OutputChangesTest::testMaximizeStateRestoredAfterEnablingOutput() // This test verifies that the window state will get restored after disabling and enabling an output, // even if its maximize state changed in the process - const auto outputs = kwinApp()->platform()->outputs(); + const auto outputs = kwinApp()->outputBackend()->outputs(); // Disable the right output { diff --git a/autotests/integration/placement_test.cpp b/autotests/integration/placement_test.cpp index 7dce5ccde3..ace57574b6 100644 --- a/autotests/integration/placement_test.cpp +++ b/autotests/integration/placement_test.cpp @@ -10,7 +10,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "placement.h" #include "wayland_server.h" @@ -79,9 +79,9 @@ void TestPlacement::initTestCase() { qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig)); diff --git a/autotests/integration/plasma_surface_test.cpp b/autotests/integration/plasma_surface_test.cpp index b43c5805c6..fc8653d15f 100644 --- a/autotests/integration/plasma_surface_test.cpp +++ b/autotests/integration/plasma_surface_test.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "virtualdesktops.h" #include "wayland_server.h" @@ -60,9 +60,9 @@ void PlasmaSurfaceTest::initTestCase() { qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 1)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 1)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); @@ -195,7 +195,7 @@ void PlasmaSurfaceTest::testOSDPlacement() // change the screen size const QVector geometries{QRect(0, 0, 1280, 1024), QRect(1280, 0, 1280, 1024)}; - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2), Q_ARG(QVector, geometries)); diff --git a/autotests/integration/plasmawindow_test.cpp b/autotests/integration/plasmawindow_test.cpp index 39b4f4f1af..d6b868c166 100644 --- a/autotests/integration/plasmawindow_test.cpp +++ b/autotests/integration/plasmawindow_test.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "wayland/seat_interface.h" #include "wayland_server.h" @@ -58,9 +58,9 @@ void PlasmaWindowTest::initTestCase() { qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); diff --git a/autotests/integration/platformcursor.cpp b/autotests/integration/platformcursor.cpp index 5b2a65b0cd..5d869320e9 100644 --- a/autotests/integration/platformcursor.cpp +++ b/autotests/integration/platformcursor.cpp @@ -8,7 +8,7 @@ */ #include "kwin_wayland_test.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "wayland_server.h" @@ -28,9 +28,9 @@ private Q_SLOTS: void PlatformCursorTest::initTestCase() { QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); diff --git a/autotests/integration/pointer_constraints_test.cpp b/autotests/integration/pointer_constraints_test.cpp index c8c4e2fb8a..da9bdf1d6c 100644 --- a/autotests/integration/pointer_constraints_test.cpp +++ b/autotests/integration/pointer_constraints_test.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "keyboard_input.h" #include "pointer_input.h" @@ -58,9 +58,9 @@ void TestPointerConstraints::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); // set custom config which disables the OnScreenNotification KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); diff --git a/autotests/integration/pointer_input.cpp b/autotests/integration/pointer_input.cpp index 15b719cde0..d61b68db82 100644 --- a/autotests/integration/pointer_input.cpp +++ b/autotests/integration/pointer_input.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "deleted.h" #include "effects.h" @@ -134,9 +134,9 @@ void PointerInputTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig)); @@ -376,7 +376,7 @@ void PointerInputTest::testUpdateFocusAfterScreenChange() QVERIFY(leftSpy.wait()); // now let's remove the screen containing the cursor - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 1), Q_ARG(QVector, QVector{QRect(0, 0, 1280, 1024)})); @@ -590,7 +590,7 @@ void PointerInputTest::testModifierClickUnrestrictedFullscreenMove() { // this test ensures that Meta+mouse button press triggers unrestricted move for fullscreen windows if (workspace()->outputs().size() < 2) { - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); } // first modify the config for this run @@ -1564,7 +1564,7 @@ void PointerInputTest::testConfineToScreenGeometry() QRect(1280, 0, 1280, 1024), QRect(2560, 0, 1280, 1024), QRect(1280, 1024, 1280, 1024)}; - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, geometries.count()), Q_ARG(QVector, geometries)); diff --git a/autotests/integration/quick_tiling_test.cpp b/autotests/integration/quick_tiling_test.cpp index b7d0eefb55..edcf3248a9 100644 --- a/autotests/integration/quick_tiling_test.cpp +++ b/autotests/integration/quick_tiling_test.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "decorations/decorationbridge.h" #include "decorations/settings.h" @@ -83,9 +83,9 @@ void QuickTilingTest::initTestCase() qRegisterMetaType(); qRegisterMetaType("MaximizeMode"); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); // set custom config which disables the Outline KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); diff --git a/autotests/integration/screen_changes_test.cpp b/autotests/integration/screen_changes_test.cpp index 1731792fda..92de7dda4b 100644 --- a/autotests/integration/screen_changes_test.cpp +++ b/autotests/integration/screen_changes_test.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "wayland_server.h" #include "workspace.h" @@ -36,9 +36,9 @@ private Q_SLOTS: void ScreenChangesTest::initTestCase() { QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 1)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 1)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); @@ -83,7 +83,7 @@ void ScreenChangesTest::testScreenAddRemove() // let's announce a new output const QVector geometries{QRect(0, 0, 1280, 1024), QRect(1280, 0, 1280, 1024)}; - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2), Q_ARG(QVector, geometries)); @@ -115,14 +115,14 @@ void ScreenChangesTest::testScreenAddRemove() QVERIFY(o1->isValid()); QSignalSpy o1ChangedSpy(o1.get(), &KWayland::Client::Output::changed); QVERIFY(o1ChangedSpy.wait()); - KWin::Output *serverOutput1 = kwinApp()->platform()->findOutput(o1->name()); // use wl_output.name to find the compositor side output + KWin::Output *serverOutput1 = kwinApp()->outputBackend()->findOutput(o1->name()); // use wl_output.name to find the compositor side output QCOMPARE(o1->globalPosition(), serverOutput1->geometry().topLeft()); QCOMPARE(o1->pixelSize(), serverOutput1->modeSize()); std::unique_ptr o2(registry.createOutput(outputAnnouncedSpy.last().first().value(), outputAnnouncedSpy.last().last().value())); QVERIFY(o2->isValid()); QSignalSpy o2ChangedSpy(o2.get(), &KWayland::Client::Output::changed); QVERIFY(o2ChangedSpy.wait()); - KWin::Output *serverOutput2 = kwinApp()->platform()->findOutput(o2->name()); // use wl_output.name to find the compositor side output + KWin::Output *serverOutput2 = kwinApp()->outputBackend()->findOutput(o2->name()); // use wl_output.name to find the compositor side output QCOMPARE(o2->globalPosition(), serverOutput2->geometry().topLeft()); QCOMPARE(o2->pixelSize(), serverOutput2->modeSize()); @@ -150,7 +150,7 @@ void ScreenChangesTest::testScreenAddRemove() QSignalSpy o2RemovedSpy(o2.get(), &KWayland::Client::Output::removed); const QVector geometries2{QRect(0, 0, 1280, 1024)}; - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 1), Q_ARG(QVector, geometries2)); diff --git a/autotests/integration/screenedge_client_show_test.cpp b/autotests/integration/screenedge_client_show_test.cpp index 7fe773bf81..ffd1a60273 100644 --- a/autotests/integration/screenedge_client_show_test.cpp +++ b/autotests/integration/screenedge_client_show_test.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "deleted.h" #include "screenedge.h" @@ -43,9 +43,9 @@ void ScreenEdgeClientShowTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); // set custom config which disable touch edge KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); diff --git a/autotests/integration/screenedges_test.cpp b/autotests/integration/screenedges_test.cpp index a180dc79e0..20cb29937f 100644 --- a/autotests/integration/screenedges_test.cpp +++ b/autotests/integration/screenedges_test.cpp @@ -10,7 +10,7 @@ #include "kwin_wayland_test.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "effectloader.h" #include "main.h" @@ -70,9 +70,9 @@ void ScreenEdgesTest::initTestCase() qRegisterMetaType("ElectricBorder"); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 1)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 1)); // Disable effects, in particular present windows, which reserves a screen edge. auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); diff --git a/autotests/integration/screens_test.cpp b/autotests/integration/screens_test.cpp index bda6400421..cc1a8d0326 100644 --- a/autotests/integration/screens_test.cpp +++ b/autotests/integration/screens_test.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "wayland_server.h" #include "window.h" @@ -43,9 +43,9 @@ void ScreensTest::initTestCase() { qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig)); @@ -85,7 +85,7 @@ void ScreensTest::cleanup() workspace()->slotReconfigure(); // Reset the screen layout of the test environment. - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); } void ScreensTest::testCurrent_data() @@ -132,7 +132,7 @@ void ScreensTest::testCurrentWithFollowsMouse() workspace()->slotReconfigure(); QFETCH(QVector, geometries); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, geometries.count()), Q_ARG(QVector, geometries)); QFETCH(QPoint, cursorPos); @@ -158,7 +158,7 @@ void ScreensTest::testCurrentPoint_data() void ScreensTest::testCurrentPoint() { QFETCH(QVector, geometries); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, geometries.count()), Q_ARG(QVector, geometries)); // Disable "active screen follows mouse" diff --git a/autotests/integration/scripting/minimizeall_test.cpp b/autotests/integration/scripting/minimizeall_test.cpp index 1c969a79a2..1ebc0d7bb4 100644 --- a/autotests/integration/scripting/minimizeall_test.cpp +++ b/autotests/integration/scripting/minimizeall_test.cpp @@ -10,7 +10,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "scripting/scripting.h" #include "wayland_server.h" #include "window.h" @@ -46,9 +46,9 @@ void MinimizeAllScriptTest::initTestCase() qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); diff --git a/autotests/integration/scripting/screenedge_test.cpp b/autotests/integration/scripting/screenedge_test.cpp index 37cc223edb..0378630113 100644 --- a/autotests/integration/scripting/screenedge_test.cpp +++ b/autotests/integration/scripting/screenedge_test.cpp @@ -8,7 +8,7 @@ */ #include "kwin_wayland_test.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "effectloader.h" #include "scripting/scripting.h" @@ -49,9 +49,9 @@ private: void ScreenEdgeTest::initTestCase() { QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 1)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 1)); // empty config to have defaults auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); diff --git a/autotests/integration/shade_test.cpp b/autotests/integration/shade_test.cpp index 7967aac8ac..7fdb26ddac 100644 --- a/autotests/integration/shade_test.cpp +++ b/autotests/integration/shade_test.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "wayland_server.h" #include "workspace.h" @@ -39,9 +39,9 @@ void ShadeTest::initTestCase() { qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); diff --git a/autotests/integration/showing_desktop_test.cpp b/autotests/integration/showing_desktop_test.cpp index 4fa1d83a77..091f8841d8 100644 --- a/autotests/integration/showing_desktop_test.cpp +++ b/autotests/integration/showing_desktop_test.cpp @@ -8,7 +8,7 @@ */ #include "kwin_wayland_test.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "wayland_server.h" #include "window.h" #include "workspace.h" @@ -36,7 +36,7 @@ void ShowingDesktopTest::initTestCase() { qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); kwinApp()->start(); diff --git a/autotests/integration/stacking_order_test.cpp b/autotests/integration/stacking_order_test.cpp index 993be404cf..e6297fb804 100644 --- a/autotests/integration/stacking_order_test.cpp +++ b/autotests/integration/stacking_order_test.cpp @@ -10,7 +10,7 @@ #include "kwin_wayland_test.h" #include "atoms.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "deleted.h" #include "main.h" #include "wayland_server.h" @@ -56,7 +56,7 @@ void StackingOrderTest::initTestCase() qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig)); diff --git a/autotests/integration/struts_test.cpp b/autotests/integration/struts_test.cpp index 6c3e943331..be3b176015 100644 --- a/autotests/integration/struts_test.cpp +++ b/autotests/integration/struts_test.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "deleted.h" #include "screenedge.h" @@ -62,9 +62,9 @@ void StrutsTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); // set custom config which disables the Outline KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); @@ -678,7 +678,7 @@ void StrutsTest::test363804() // this test verifies the condition described in BUG 363804 // two screens in a vertical setup, aligned to right border with panel on the bottom screen const QVector geometries{QRect(0, 0, 1920, 1080), QRect(554, 1080, 1366, 768)}; - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2), Q_ARG(QVector, geometries)); @@ -760,7 +760,7 @@ void StrutsTest::testLeftScreenSmallerBottomAligned() // what this test in addition tests is whether a window larger than the left screen is not placed into // the dead area const QVector geometries{QRect(0, 282, 1366, 768), QRect(1366, 0, 1680, 1050)}; - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2), Q_ARG(QVector, geometries)); @@ -874,7 +874,7 @@ void StrutsTest::testWindowMoveWithPanelBetweenScreens() // left screen must be smaller than right screen const QVector geometries{QRect(0, 282, 1366, 768), QRect(1366, 0, 1680, 1050)}; - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2), Q_ARG(QVector, geometries)); diff --git a/autotests/integration/tabbox_test.cpp b/autotests/integration/tabbox_test.cpp index 60ab8e7123..f838930fab 100644 --- a/autotests/integration/tabbox_test.cpp +++ b/autotests/integration/tabbox_test.cpp @@ -8,7 +8,7 @@ */ #include "kwin_wayland_test.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "input.h" #include "tabbox/tabbox.h" @@ -42,9 +42,9 @@ void TabBoxTest::initTestCase() { qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); KSharedConfigPtr c = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); c->group("TabBox").writeEntry("ShowTabBox", false); diff --git a/autotests/integration/test_virtualkeyboard_dbus.cpp b/autotests/integration/test_virtualkeyboard_dbus.cpp index 79849e5e65..b689fb8418 100644 --- a/autotests/integration/test_virtualkeyboard_dbus.cpp +++ b/autotests/integration/test_virtualkeyboard_dbus.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "main.h" #include "virtualkeyboard_dbus.h" #include "wayland_server.h" @@ -44,9 +44,9 @@ void VirtualKeyboardDBusTest::initTestCase() { QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.kwin.testvirtualkeyboard")); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); static_cast(kwinApp())->setInputMethodServerToStart("internal"); kwinApp()->start(); diff --git a/autotests/integration/touch_input_test.cpp b/autotests/integration/touch_input_test.cpp index caae4eac56..84b8e80816 100644 --- a/autotests/integration/touch_input_test.cpp +++ b/autotests/integration/touch_input_test.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "touch_input.h" #include "wayland_server.h" @@ -54,9 +54,9 @@ void TouchInputTest::initTestCase() { qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); diff --git a/autotests/integration/transient_placement.cpp b/autotests/integration/transient_placement.cpp index e654724949..3b9387102d 100644 --- a/autotests/integration/transient_placement.cpp +++ b/autotests/integration/transient_placement.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "wayland/seat_interface.h" #include "wayland/surface_interface.h" @@ -62,9 +62,9 @@ void TransientPlacementTest::initTestCase() { qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); diff --git a/autotests/integration/virtual_desktop_test.cpp b/autotests/integration/virtual_desktop_test.cpp index 83524d1c55..728bd9a8e1 100644 --- a/autotests/integration/virtual_desktop_test.cpp +++ b/autotests/integration/virtual_desktop_test.cpp @@ -8,7 +8,7 @@ */ #include "kwin_wayland_test.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "main.h" #include "virtualdesktops.h" #include "wayland_server.h" @@ -39,7 +39,7 @@ void VirtualDesktopTest::initTestCase() { qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig)); diff --git a/autotests/integration/window_rules_test.cpp b/autotests/integration/window_rules_test.cpp index d4406c0293..b2b43721f3 100644 --- a/autotests/integration/window_rules_test.cpp +++ b/autotests/integration/window_rules_test.cpp @@ -10,7 +10,7 @@ #include "atoms.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "deleted.h" #include "rules.h" @@ -43,9 +43,9 @@ void WindowRuleTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); diff --git a/autotests/integration/window_selection_test.cpp b/autotests/integration/window_selection_test.cpp index c1a03f9d15..d94c9d5b0b 100644 --- a/autotests/integration/window_selection_test.cpp +++ b/autotests/integration/window_selection_test.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "keyboard_input.h" #include "pointer_input.h" @@ -54,9 +54,9 @@ void TestWindowSelection::initTestCase() { qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); qputenv("XKB_DEFAULT_RULES", "evdev"); kwinApp()->start(); diff --git a/autotests/integration/x11_window_test.cpp b/autotests/integration/x11_window_test.cpp index 75aa4b1e84..4d4f570233 100644 --- a/autotests/integration/x11_window_test.cpp +++ b/autotests/integration/x11_window_test.cpp @@ -10,7 +10,7 @@ #include "atoms.h" #include "composite.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "deleted.h" #include "effectloader.h" @@ -65,7 +65,7 @@ void X11WindowTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig)); diff --git a/autotests/integration/xdgshellwindow_rules_test.cpp b/autotests/integration/xdgshellwindow_rules_test.cpp index 0d6950322f..298acc4772 100644 --- a/autotests/integration/xdgshellwindow_rules_test.cpp +++ b/autotests/integration/xdgshellwindow_rules_test.cpp @@ -12,8 +12,8 @@ #include "kwin_wayland_test.h" #include "core/output.h" +#include "core/outputbackend.h" #include "core/outputconfiguration.h" -#include "core/platform.h" #include "cursor.h" #include "rules.h" #include "virtualdesktops.h" @@ -178,9 +178,9 @@ void TestXdgShellWindowRules::initTestCase() qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); diff --git a/autotests/integration/xdgshellwindow_test.cpp b/autotests/integration/xdgshellwindow_test.cpp index 86f8592221..c931300b37 100644 --- a/autotests/integration/xdgshellwindow_test.cpp +++ b/autotests/integration/xdgshellwindow_test.cpp @@ -10,7 +10,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "decorations/decorationbridge.h" #include "decorations/settings.h" @@ -166,9 +166,9 @@ void TestXdgShellWindow::initTestCase() qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); diff --git a/autotests/integration/xwayland_input_test.cpp b/autotests/integration/xwayland_input_test.cpp index 28ad00c86b..fad98ec91f 100644 --- a/autotests/integration/xwayland_input_test.cpp +++ b/autotests/integration/xwayland_input_test.cpp @@ -9,7 +9,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "deleted.h" #include "wayland/seat_interface.h" @@ -42,9 +42,9 @@ void XWaylandInputTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); diff --git a/autotests/integration/xwayland_selections_test.cpp b/autotests/integration/xwayland_selections_test.cpp index 27dd7bcb72..c3af600f01 100644 --- a/autotests/integration/xwayland_selections_test.cpp +++ b/autotests/integration/xwayland_selections_test.cpp @@ -10,7 +10,7 @@ #include "kwin_wayland_test.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "wayland/seat_interface.h" #include "wayland_server.h" #include "window.h" @@ -50,11 +50,11 @@ void XwaylandSelectionsTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); // QSignalSpy clipboardSyncDevicedCreated{waylandServer(), &WaylandServer::xclipboardSyncDataDeviceCreated}; // QVERIFY(clipboardSyncDevicedCreated.isValid()); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->start(); QVERIFY(applicationStartedSpy.wait()); diff --git a/autotests/integration/xwaylandserver_crash_test.cpp b/autotests/integration/xwaylandserver_crash_test.cpp index af011e19e9..77807d128b 100644 --- a/autotests/integration/xwaylandserver_crash_test.cpp +++ b/autotests/integration/xwaylandserver_crash_test.cpp @@ -8,7 +8,7 @@ #include "composite.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "main.h" #include "scene.h" #include "unmanaged.h" @@ -47,9 +47,9 @@ void XwaylandServerCrashTest::initTestCase() qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); KConfigGroup xwaylandGroup = config->group("Xwayland"); diff --git a/autotests/integration/xwaylandserver_restart_test.cpp b/autotests/integration/xwaylandserver_restart_test.cpp index df37a868d4..8e8163e99b 100644 --- a/autotests/integration/xwaylandserver_restart_test.cpp +++ b/autotests/integration/xwaylandserver_restart_test.cpp @@ -7,7 +7,7 @@ #include "kwin_wayland_test.h" #include "composite.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "main.h" #include "scene.h" #include "wayland_server.h" @@ -43,9 +43,9 @@ private Q_SLOTS: void XwaylandServerRestartTest::initTestCase() { QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); + kwinApp()->outputBackend()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); + QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); KConfigGroup xwaylandGroup = config->group("Xwayland"); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f82ad943d2..2ed012d8b6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -42,10 +42,10 @@ target_sources(kwin PRIVATE core/inputbackend.cpp core/inputdevice.cpp core/output.cpp + core/outputbackend.cpp core/outputconfiguration.cpp core/outputlayer.cpp core/overlaywindow.cpp - core/platform.cpp core/renderbackend.cpp core/renderjournal.cpp core/renderlayer.cpp diff --git a/src/backends/drm/drm_backend.cpp b/src/backends/drm/drm_backend.cpp index 6686aecd74..37efbc9ba1 100644 --- a/src/backends/drm/drm_backend.cpp +++ b/src/backends/drm/drm_backend.cpp @@ -70,7 +70,7 @@ static QStringList splitPathList(const QString &input, const QChar delimiter) } DrmBackend::DrmBackend(Session *session, QObject *parent) - : Platform(parent) + : OutputBackend(parent) , m_udev(std::make_unique()) , m_udevMonitor(m_udev->monitor()) , m_session(session) diff --git a/src/backends/drm/drm_backend.h b/src/backends/drm/drm_backend.h index 2c0919da85..2dd688bb70 100644 --- a/src/backends/drm/drm_backend.h +++ b/src/backends/drm/drm_backend.h @@ -7,7 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #pragma once -#include "core/platform.h" +#include "core/outputbackend.h" #include "dpmsinputeventfilter.h" @@ -34,7 +34,7 @@ class DrmGpu; class DrmVirtualOutput; class DrmRenderBackend; -class KWIN_EXPORT DrmBackend : public Platform +class KWIN_EXPORT DrmBackend : public OutputBackend { Q_OBJECT diff --git a/src/backends/libinput/connection.cpp b/src/backends/libinput/connection.cpp index c94643f092..b3917f7203 100644 --- a/src/backends/libinput/connection.cpp +++ b/src/backends/libinput/connection.cpp @@ -14,7 +14,7 @@ // TODO: Make it compile also in testing environment #ifndef KWIN_BUILD_TESTING #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "main.h" #include "window.h" #include "workspace.h" @@ -136,7 +136,7 @@ void Connection::doSetup() deactivate(); } }); - connect(kwinApp()->platform(), &Platform::outputsQueried, this, &Connection::updateScreens); + connect(kwinApp()->outputBackend(), &OutputBackend::outputsQueried, this, &Connection::updateScreens); handleEvent(); } @@ -564,7 +564,7 @@ void Connection::applyScreenToDevice(Device *device) } Output *deviceOutput = nullptr; - const QVector outputs = kwinApp()->platform()->outputs(); + const QVector outputs = kwinApp()->outputBackend()->outputs(); // let's try to find a screen for it if (!device->outputName().isEmpty()) { diff --git a/src/backends/libinput/device.cpp b/src/backends/libinput/device.cpp index 9f12a56d56..819ae758b3 100644 --- a/src/backends/libinput/device.cpp +++ b/src/backends/libinput/device.cpp @@ -11,7 +11,7 @@ #include #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "libinput_logging.h" #include "main.h" #include "mousebuttons.h" @@ -633,7 +633,7 @@ void Device::setOutputName(const QString &name) } setOutput(nullptr); - auto outputs = kwinApp()->platform()->outputs(); + auto outputs = kwinApp()->outputBackend()->outputs(); for (int i = 0; i < outputs.count(); ++i) { if (!outputs[i]->isEnabled()) { continue; diff --git a/src/backends/virtual/virtual_backend.cpp b/src/backends/virtual/virtual_backend.cpp index 70ae539402..452c67e520 100644 --- a/src/backends/virtual/virtual_backend.cpp +++ b/src/backends/virtual/virtual_backend.cpp @@ -18,7 +18,7 @@ namespace KWin { VirtualBackend::VirtualBackend(QObject *parent) - : Platform(parent) + : OutputBackend(parent) { if (qEnvironmentVariableIsSet("KWIN_WAYLAND_VIRTUAL_SCREENSHOTS")) { m_screenshotDir.reset(new QTemporaryDir); diff --git a/src/backends/virtual/virtual_backend.h b/src/backends/virtual/virtual_backend.h index a4e0b0d36a..b0e44878ea 100644 --- a/src/backends/virtual/virtual_backend.h +++ b/src/backends/virtual/virtual_backend.h @@ -8,7 +8,7 @@ */ #pragma once -#include "core/platform.h" +#include "core/outputbackend.h" #include @@ -22,7 +22,7 @@ namespace KWin class VirtualBackend; class VirtualOutput; -class KWIN_EXPORT VirtualBackend : public Platform +class KWIN_EXPORT VirtualBackend : public OutputBackend { Q_OBJECT diff --git a/src/backends/wayland/wayland_backend.cpp b/src/backends/wayland/wayland_backend.cpp index cbf5245bd2..4825b789c6 100644 --- a/src/backends/wayland/wayland_backend.cpp +++ b/src/backends/wayland/wayland_backend.cpp @@ -541,7 +541,7 @@ void WaylandSeat::destroyTouchDevice() } WaylandBackend::WaylandBackend(QObject *parent) - : Platform(parent) + : OutputBackend(parent) , m_display(nullptr) , m_eventQueue(std::make_unique()) , m_registry(std::make_unique()) diff --git a/src/backends/wayland/wayland_backend.h b/src/backends/wayland/wayland_backend.h index e2cfa71730..e698e67325 100644 --- a/src/backends/wayland/wayland_backend.h +++ b/src/backends/wayland/wayland_backend.h @@ -13,7 +13,7 @@ // KWin #include "core/inputbackend.h" #include "core/inputdevice.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "utils/filedescriptor.h" #include // Qt @@ -242,7 +242,7 @@ private: * It creates the connection to the Wayland Compositor, sets up the registry and creates * the Wayland output surfaces and its shell mappings. */ -class KWIN_EXPORT WaylandBackend : public Platform +class KWIN_EXPORT WaylandBackend : public OutputBackend { Q_OBJECT diff --git a/src/backends/x11/common/x11_common_egl_backend.cpp b/src/backends/x11/common/x11_common_egl_backend.cpp index e635e797e6..f5ee2f9a50 100644 --- a/src/backends/x11/common/x11_common_egl_backend.cpp +++ b/src/backends/x11/common/x11_common_egl_backend.cpp @@ -10,7 +10,7 @@ // kwineffects #include // kwin -#include "core/platform.h" +#include "core/outputbackend.h" #include "main.h" #include "utils/common.h" #include "utils/xcbutils.h" @@ -90,7 +90,7 @@ void EglOnXBackend::init() bool EglOnXBackend::initRenderingContext() { initClientExtensions(); - EGLDisplay dpy = kwinApp()->platform()->sceneEglDisplay(); + EGLDisplay dpy = kwinApp()->outputBackend()->sceneEglDisplay(); // Use eglGetPlatformDisplayEXT() to get the display pointer // if the implementation supports it. diff --git a/src/backends/x11/standalone/x11_standalone_effects.cpp b/src/backends/x11/standalone/x11_standalone_effects.cpp index 170141909e..34f9e85835 100644 --- a/src/backends/x11/standalone/x11_standalone_effects.cpp +++ b/src/backends/x11/standalone/x11_standalone_effects.cpp @@ -44,7 +44,7 @@ EffectsHandlerImplX11::~EffectsHandlerImplX11() bool EffectsHandlerImplX11::doGrabKeyboard() { - auto keyboard = static_cast(kwinApp()->platform())->keyboard(); + auto keyboard = static_cast(kwinApp()->outputBackend())->keyboard(); if (!keyboard->xkbKeymap()) { return false; } diff --git a/src/backends/x11/standalone/x11_standalone_egl_backend.cpp b/src/backends/x11/standalone/x11_standalone_egl_backend.cpp index 84ce47ec1e..bb604395bd 100644 --- a/src/backends/x11/standalone/x11_standalone_egl_backend.cpp +++ b/src/backends/x11/standalone/x11_standalone_egl_backend.cpp @@ -6,8 +6,8 @@ */ #include "x11_standalone_egl_backend.h" +#include "core/outputbackend.h" #include "core/overlaywindow.h" -#include "core/platform.h" #include "core/renderloop_p.h" #include "kwinglplatform.h" #include "options.h" @@ -119,8 +119,8 @@ void EglBackend::init() m_fbo = std::make_unique(0, workspace()->geometry().size()); - kwinApp()->platform()->setSceneEglDisplay(shareDisplay); - kwinApp()->platform()->setSceneEglGlobalShareContext(shareContext); + kwinApp()->outputBackend()->setSceneEglDisplay(shareDisplay); + kwinApp()->outputBackend()->setSceneEglGlobalShareContext(shareContext); EglOnXBackend::init(); } diff --git a/src/backends/x11/standalone/x11_standalone_glx_backend.cpp b/src/backends/x11/standalone/x11_standalone_glx_backend.cpp index ad823f2aca..a849f8086a 100644 --- a/src/backends/x11/standalone/x11_standalone_glx_backend.cpp +++ b/src/backends/x11/standalone/x11_standalone_glx_backend.cpp @@ -24,8 +24,8 @@ #include "x11_standalone_sgivideosyncvsyncmonitor.h" // kwin #include "composite.h" +#include "core/outputbackend.h" #include "core/overlaywindow.h" -#include "core/platform.h" #include "core/renderloop_p.h" #include "options.h" #include "scene.h" @@ -98,7 +98,7 @@ bool SwapEventFilter::event(xcb_generic_event_t *event) // it's CLOCK_MONOTONIC, so no special conversions are needed. const std::chrono::microseconds timestamp((uint64_t(swapEvent->ust_hi) << 32) | swapEvent->ust_lo); - const auto platform = static_cast(kwinApp()->platform()); + const auto platform = static_cast(kwinApp()->outputBackend()); RenderLoopPrivate::get(platform->renderLoop())->notifyFrameCompleted(timestamp); return true; diff --git a/src/backends/x11/standalone/x11_standalone_platform.cpp b/src/backends/x11/standalone/x11_standalone_platform.cpp index 898a48af0e..deab855c9d 100644 --- a/src/backends/x11/standalone/x11_standalone_platform.cpp +++ b/src/backends/x11/standalone/x11_standalone_platform.cpp @@ -100,7 +100,7 @@ bool XrandrEventFilter::event(xcb_generic_event_t *event) } X11StandalonePlatform::X11StandalonePlatform(QObject *parent) - : Platform(parent) + : OutputBackend(parent) , m_updateOutputsTimer(std::make_unique()) , m_x11Display(QX11Info::display()) , m_renderLoop(std::make_unique()) @@ -474,7 +474,7 @@ static int currentRefreshRate() return refreshRate; } - const QVector outputs = kwinApp()->platform()->outputs(); + const QVector outputs = kwinApp()->outputBackend()->outputs(); if (outputs.isEmpty()) { return 60000; } diff --git a/src/backends/x11/standalone/x11_standalone_platform.h b/src/backends/x11/standalone/x11_standalone_platform.h index 91b3b7ea39..a0d3dea7d4 100644 --- a/src/backends/x11/standalone/x11_standalone_platform.h +++ b/src/backends/x11/standalone/x11_standalone_platform.h @@ -8,7 +8,7 @@ */ #ifndef KWIN_X11_PLATFORM_H #define KWIN_X11_PLATFORM_H -#include "core/platform.h" +#include "core/outputbackend.h" #include @@ -35,7 +35,7 @@ class Compositor; class Scene; class Window; -class KWIN_EXPORT X11StandalonePlatform : public Platform +class KWIN_EXPORT X11StandalonePlatform : public OutputBackend { Q_OBJECT diff --git a/src/backends/x11/standalone/x11_standalone_xinputintegration.cpp b/src/backends/x11/standalone/x11_standalone_xinputintegration.cpp index 6a9c08f28e..83c1bb67b6 100644 --- a/src/backends/x11/standalone/x11_standalone_xinputintegration.cpp +++ b/src/backends/x11/standalone/x11_standalone_xinputintegration.cpp @@ -7,7 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "x11_standalone_xinputintegration.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "gestures.h" #include "keyboard_input.h" #include "main.h" diff --git a/src/backends/x11/windowed/x11_windowed_backend.h b/src/backends/x11/windowed/x11_windowed_backend.h index 8061a3f0f5..ac3a0d9a39 100644 --- a/src/backends/x11/windowed/x11_windowed_backend.h +++ b/src/backends/x11/windowed/x11_windowed_backend.h @@ -10,7 +10,7 @@ #include "core/inputbackend.h" #include "core/inputdevice.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include @@ -81,7 +81,7 @@ private: X11WindowedBackend *m_backend; }; -class KWIN_EXPORT X11WindowedBackend : public Platform +class KWIN_EXPORT X11WindowedBackend : public OutputBackend { Q_OBJECT diff --git a/src/composite.cpp b/src/composite.cpp index 35c016013b..c98b67b9ea 100644 --- a/src/composite.cpp +++ b/src/composite.cpp @@ -11,9 +11,9 @@ #include #include "core/output.h" +#include "core/outputbackend.h" #include "core/outputlayer.h" #include "core/overlaywindow.h" -#include "core/platform.h" #include "core/renderlayer.h" #include "core/renderloop.h" #include "cursordelegate_opengl.h" @@ -141,11 +141,11 @@ Compositor::Compositor(QObject *workspace) // The ctor of this class is invoked from the Workspace ctor, that means before // Workspace is completely constructed, so calling Workspace::self() would result // in undefined behavior. This is fixed by using a delayed invocation. - if (kwinApp()->platform()->isReady()) { + if (kwinApp()->outputBackend()->isReady()) { QTimer::singleShot(0, this, &Compositor::start); } connect( - kwinApp()->platform(), &Platform::readyChanged, this, [this](bool ready) { + kwinApp()->outputBackend(), &OutputBackend::readyChanged, this, [this](bool ready) { if (ready) { start(); } else { @@ -182,7 +182,7 @@ bool Compositor::attemptOpenGLCompositing() createOpenGLSafePoint(OpenGLSafePoint::PostInit); }); - std::unique_ptr backend = kwinApp()->platform()->createOpenGLBackend(); + std::unique_ptr backend = kwinApp()->outputBackend()->createOpenGLBackend(); if (!backend) { return false; } @@ -212,7 +212,7 @@ bool Compositor::attemptOpenGLCompositing() bool Compositor::attemptQPainterCompositing() { - std::unique_ptr backend(kwinApp()->platform()->createQPainterBackend()); + std::unique_ptr backend(kwinApp()->outputBackend()->createQPainterBackend()); if (!backend || backend->isFailed()) { return false; } @@ -255,7 +255,7 @@ bool Compositor::setupStart() Q_EMIT aboutToToggleCompositing(); - const QVector availableCompositors = kwinApp()->platform()->supportedCompositors(); + const QVector availableCompositors = kwinApp()->outputBackend()->supportedCompositors(); QVector candidateCompositors; // If compositing has been restarted, try to use the last used compositing type. diff --git a/src/core/platform.cpp b/src/core/outputbackend.cpp similarity index 58% rename from src/core/platform.cpp rename to src/core/outputbackend.cpp index 7360073e44..8227ebefdc 100644 --- a/src/core/platform.cpp +++ b/src/core/outputbackend.cpp @@ -7,7 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ -#include "platform.h" +#include "outputbackend.h" #include "dmabuftexture.h" #include "inputbackend.h" @@ -19,47 +19,47 @@ namespace KWin { -Platform::Platform(QObject *parent) +OutputBackend::OutputBackend(QObject *parent) : QObject(parent) , m_eglDisplay(EGL_NO_DISPLAY) { } -Platform::~Platform() +OutputBackend::~OutputBackend() { } -std::unique_ptr Platform::createInputBackend() +std::unique_ptr OutputBackend::createInputBackend() { return nullptr; } -std::unique_ptr Platform::createOpenGLBackend() +std::unique_ptr OutputBackend::createOpenGLBackend() { return nullptr; } -std::unique_ptr Platform::createQPainterBackend() +std::unique_ptr OutputBackend::createQPainterBackend() { return nullptr; } -std::optional Platform::testCreateDmaBuf(const QSize &size, quint32 format, const QVector &modifiers) +std::optional OutputBackend::testCreateDmaBuf(const QSize &size, quint32 format, const QVector &modifiers) { return {}; } -std::shared_ptr Platform::createDmaBufTexture(const QSize &size, quint32 format, uint64_t modifier) +std::shared_ptr OutputBackend::createDmaBufTexture(const QSize &size, quint32 format, uint64_t modifier) { return {}; } -std::shared_ptr Platform::createDmaBufTexture(const DmaBufParams &attribs) +std::shared_ptr OutputBackend::createDmaBufTexture(const DmaBufParams &attribs) { return createDmaBufTexture({attribs.width, attribs.height}, attribs.format, attribs.modifier); } -bool Platform::applyOutputChanges(const OutputConfiguration &config) +bool OutputBackend::applyOutputChanges(const OutputConfiguration &config) { const auto availableOutputs = outputs(); QVector toBeEnabledOutputs; @@ -80,7 +80,7 @@ bool Platform::applyOutputChanges(const OutputConfiguration &config) return true; } -Output *Platform::findOutput(const QString &name) const +Output *OutputBackend::findOutput(const QString &name) const { const auto candidates = outputs(); for (Output *candidate : candidates) { @@ -91,7 +91,7 @@ Output *Platform::findOutput(const QString &name) const return nullptr; } -void Platform::setReady(bool ready) +void OutputBackend::setReady(bool ready) { if (m_ready == ready) { return; @@ -100,37 +100,37 @@ void Platform::setReady(bool ready) Q_EMIT readyChanged(m_ready); } -Output *Platform::createVirtualOutput(const QString &name, const QSize &size, double scale) +Output *OutputBackend::createVirtualOutput(const QString &name, const QSize &size, double scale) { return nullptr; } -void Platform::removeVirtualOutput(Output *output) +void OutputBackend::removeVirtualOutput(Output *output) { Q_ASSERT(!output); } -EGLDisplay KWin::Platform::sceneEglDisplay() const +EGLDisplay KWin::OutputBackend::sceneEglDisplay() const { return m_eglDisplay; } -void Platform::setSceneEglDisplay(EGLDisplay display) +void OutputBackend::setSceneEglDisplay(EGLDisplay display) { m_eglDisplay = display; } -QString Platform::supportInformation() const +QString OutputBackend::supportInformation() const { return QStringLiteral("Name: %1\n").arg(metaObject()->className()); } -EGLContext Platform::sceneEglGlobalShareContext() const +EGLContext OutputBackend::sceneEglGlobalShareContext() const { return m_globalShareContext; } -void Platform::setSceneEglGlobalShareContext(EGLContext context) +void OutputBackend::setSceneEglGlobalShareContext(EGLContext context) { m_globalShareContext = context; } diff --git a/src/core/platform.h b/src/core/outputbackend.h similarity index 96% rename from src/core/platform.h rename to src/core/outputbackend.h index 6cfbdbf4d2..8836a36c51 100644 --- a/src/core/platform.h +++ b/src/core/outputbackend.h @@ -6,8 +6,9 @@ SPDX-License-Identifier: GPL-2.0-or-later */ -#ifndef KWIN_PLATFORM_H -#define KWIN_PLATFORM_H + +#pragma once + #include #include #include @@ -40,11 +41,11 @@ public: } }; -class KWIN_EXPORT Platform : public QObject +class KWIN_EXPORT OutputBackend : public QObject { Q_OBJECT public: - ~Platform() override; + ~OutputBackend() override; virtual bool initialize() = 0; virtual std::unique_ptr createInputBackend(); @@ -146,7 +147,7 @@ Q_SIGNALS: void outputRemoved(Output *output); protected: - explicit Platform(QObject *parent = nullptr); + explicit OutputBackend(QObject *parent = nullptr); void setReady(bool ready); QSize initialWindowSize() const { @@ -168,5 +169,3 @@ private: }; } // namespace KWin - -#endif diff --git a/src/input.cpp b/src/input.cpp index 46fb9c2388..74a701789e 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -34,7 +34,7 @@ #include "tabbox/tabbox.h" #endif #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "cursor.h" #include "internalwindow.h" #include "popup_input_filter.h" @@ -3003,7 +3003,7 @@ void InputRedirection::addInputBackend(std::unique_ptr &&inputBack void InputRedirection::setupInputBackends() { - std::unique_ptr inputBackend = kwinApp()->platform()->createInputBackend(); + std::unique_ptr inputBackend = kwinApp()->outputBackend()->createInputBackend(); if (inputBackend) { addInputBackend(std::move(inputBackend)); } diff --git a/src/main.cpp b/src/main.cpp index d1abc3d3ed..c3e58b28b7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,7 +14,7 @@ #include "atoms.h" #include "colormanager.h" #include "composite.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "core/session.h" #include "cursor.h" #include "effects.h" @@ -155,7 +155,7 @@ void Application::destroyAtoms() void Application::destroyPlatform() { - m_platform.reset(); + m_outputBackend.reset(); } void Application::resetCrashesCount() @@ -618,10 +618,10 @@ void Application::setProcessStartupEnvironment(const QProcessEnvironment &enviro m_processEnvironment = environment; } -void Application::setPlatform(std::unique_ptr &&platform) +void Application::setOutputBackend(std::unique_ptr &&backend) { - Q_ASSERT(!m_platform); - m_platform = std::move(platform); + Q_ASSERT(!m_outputBackend); + m_outputBackend = std::move(backend); } void Application::setSession(std::unique_ptr &&session) diff --git a/src/main.h b/src/main.h index aaf342ad46..57518b7f77 100644 --- a/src/main.h +++ b/src/main.h @@ -27,7 +27,7 @@ class QCommandLineParser; namespace KWin { -class Platform; +class OutputBackend; class Session; class X11EventFilter; class PluginManager; @@ -221,11 +221,11 @@ public: QProcessEnvironment processStartupEnvironment() const; void setProcessStartupEnvironment(const QProcessEnvironment &environment); - Platform *platform() const + OutputBackend *outputBackend() const { - return m_platform.get(); + return m_outputBackend.get(); } - void setPlatform(std::unique_ptr &&platform); + void setOutputBackend(std::unique_ptr &&backend); Session *session() const { @@ -366,7 +366,7 @@ private: bool m_useKActivities = true; #endif std::unique_ptr m_session; - std::unique_ptr m_platform; + std::unique_ptr m_outputBackend; bool m_terminating = false; qreal m_xwaylandScale = 1; QProcessEnvironment m_processEnvironment; diff --git a/src/main_wayland.cpp b/src/main_wayland.cpp index d801f6b2e5..84e30fa340 100644 --- a/src/main_wayland.cpp +++ b/src/main_wayland.cpp @@ -15,7 +15,7 @@ #include "backends/wayland/wayland_backend.h" #include "backends/x11/windowed/x11_windowed_backend.h" #include "composite.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "core/session.h" #include "effects.h" #include "inputmethod.h" @@ -139,7 +139,7 @@ void ApplicationWayland::performStartup() // first load options - done internally by a different thread createOptions(); - if (!platform()->initialize()) { + if (!outputBackend()->initialize()) { std::exit(1); } @@ -149,7 +149,7 @@ void ApplicationWayland::performStartup() WaylandCompositor::create(); - connect(Compositor::self(), &Compositor::sceneCreated, platform(), &Platform::sceneInitialized); + connect(Compositor::self(), &Compositor::sceneCreated, outputBackend(), &OutputBackend::sceneInitialized); connect(Compositor::self(), &Compositor::sceneCreated, this, &ApplicationWayland::continueStartupWithScene); } @@ -554,30 +554,30 @@ int main(int argc, char *argv[]) std::cerr << "FATAl ERROR: could not acquire a session" << std::endl; return 1; } - a.setPlatform(std::make_unique(a.session())); + a.setOutputBackend(std::make_unique(a.session())); break; case BackendType::Virtual: a.setSession(KWin::Session::create(KWin::Session::Type::Noop)); - a.setPlatform(std::make_unique()); + a.setOutputBackend(std::make_unique()); break; case BackendType::X11: a.setSession(KWin::Session::create(KWin::Session::Type::Noop)); - a.setPlatform(std::make_unique()); + a.setOutputBackend(std::make_unique()); break; case BackendType::Wayland: a.setSession(KWin::Session::create(KWin::Session::Type::Noop)); - a.setPlatform(std::make_unique()); + a.setOutputBackend(std::make_unique()); break; } if (!deviceIdentifier.isEmpty()) { - a.platform()->setDeviceIdentifier(deviceIdentifier); + a.outputBackend()->setDeviceIdentifier(deviceIdentifier); } if (initialWindowSize.isValid()) { - a.platform()->setInitialWindowSize(initialWindowSize); + a.outputBackend()->setInitialWindowSize(initialWindowSize); } - a.platform()->setInitialOutputScale(outputScale); - a.platform()->setInitialOutputCount(outputCount); + a.outputBackend()->setInitialOutputScale(outputScale); + a.outputBackend()->setInitialOutputCount(outputCount); QObject::connect(&a, &KWin::Application::workspaceCreated, server, &KWin::WaylandServer::initWorkspace); if (!server->socketName().isEmpty()) { diff --git a/src/main_x11.cpp b/src/main_x11.cpp index 91c7968667..e9ca29c6b3 100644 --- a/src/main_x11.cpp +++ b/src/main_x11.cpp @@ -13,7 +13,7 @@ #include #include "backends/x11/standalone/x11_standalone_platform.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "core/session.h" #include "outline.h" #include "screenedge.h" @@ -200,12 +200,12 @@ void ApplicationX11::setReplace(bool replace) std::unique_ptr ApplicationX11::createScreenEdge(ScreenEdges *parent) { - return static_cast(platform())->createScreenEdge(parent); + return static_cast(outputBackend())->createScreenEdge(parent); } void ApplicationX11::createPlatformCursor(QObject *parent) { - static_cast(platform())->createPlatformCursor(parent); + static_cast(outputBackend())->createPlatformCursor(parent); } std::unique_ptr ApplicationX11::createOutline(Outline *outline) @@ -214,27 +214,27 @@ std::unique_ptr ApplicationX11::createOutline(Outline *outline) if (auto outlineVisual = Application::createOutline(outline)) { return outlineVisual; } - return static_cast(platform())->createOutline(outline); + return static_cast(outputBackend())->createOutline(outline); } void ApplicationX11::createEffectsHandler(Compositor *compositor, Scene *scene) { - static_cast(platform())->createEffectsHandler(compositor, scene); + static_cast(outputBackend())->createEffectsHandler(compositor, scene); } void ApplicationX11::startInteractiveWindowSelection(std::function callback, const QByteArray &cursorName) { - static_cast(platform())->startInteractiveWindowSelection(callback, cursorName); + static_cast(outputBackend())->startInteractiveWindowSelection(callback, cursorName); } void ApplicationX11::startInteractivePositionSelection(std::function callback) { - static_cast(platform())->startInteractivePositionSelection(callback); + static_cast(outputBackend())->startInteractivePositionSelection(callback); } PlatformCursorImage ApplicationX11::cursorImage() const { - return static_cast(platform())->cursorImage(); + return static_cast(outputBackend())->cursorImage(); } void ApplicationX11::lostSelection() @@ -265,7 +265,7 @@ void ApplicationX11::performStartup() // first load options - done internally by a different thread createOptions(); - if (!platform()->initialize()) { + if (!outputBackend()->initialize()) { std::exit(1); } @@ -441,7 +441,7 @@ int main(int argc, char *argv[]) } a.setSession(KWin::Session::create(KWin::Session::Type::Noop)); - a.setPlatform(std::make_unique()); + a.setOutputBackend(std::make_unique()); a.start(); return a.exec(); diff --git a/src/options.cpp b/src/options.cpp index 2318ca322d..f21ea6615c 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -12,7 +12,7 @@ #include "config-kwin.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "utils/common.h" #ifndef KCMRULES @@ -835,7 +835,7 @@ bool Options::loadCompositingConfig(bool force) } setCompositingMode(compositingMode); - const bool platformSupportsNoCompositing = kwinApp()->platform()->supportedCompositors().contains(NoCompositing); + const bool platformSupportsNoCompositing = kwinApp()->outputBackend()->supportedCompositors().contains(NoCompositing); if (m_compositingMode == NoCompositing && platformSupportsNoCompositing) { setUseCompositing(false); return false; // do not even detect compositing preferences if explicitly disabled diff --git a/src/platformsupport/scenes/opengl/abstract_egl_backend.cpp b/src/platformsupport/scenes/opengl/abstract_egl_backend.cpp index 70a43df752..fe433ce436 100644 --- a/src/platformsupport/scenes/opengl/abstract_egl_backend.cpp +++ b/src/platformsupport/scenes/opengl/abstract_egl_backend.cpp @@ -9,7 +9,7 @@ #include "abstract_egl_backend.h" #include "composite.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "dmabuftexture.h" #include "egl_dmabuf.h" #include "options.h" @@ -55,24 +55,24 @@ AbstractEglBackend::~AbstractEglBackend() EGLContext AbstractEglBackend::ensureGlobalShareContext() { - if (kwinApp()->platform()->sceneEglGlobalShareContext() != EGL_NO_CONTEXT) { - return kwinApp()->platform()->sceneEglGlobalShareContext(); + if (kwinApp()->outputBackend()->sceneEglGlobalShareContext() != EGL_NO_CONTEXT) { + return kwinApp()->outputBackend()->sceneEglGlobalShareContext(); } s_globalShareContext = createContextInternal(EGL_NO_CONTEXT); - kwinApp()->platform()->setSceneEglGlobalShareContext(s_globalShareContext); + kwinApp()->outputBackend()->setSceneEglGlobalShareContext(s_globalShareContext); return s_globalShareContext; } void AbstractEglBackend::destroyGlobalShareContext() { - const EGLDisplay eglDisplay = kwinApp()->platform()->sceneEglDisplay(); + const EGLDisplay eglDisplay = kwinApp()->outputBackend()->sceneEglDisplay(); if (eglDisplay == EGL_NO_DISPLAY || s_globalShareContext == EGL_NO_CONTEXT) { return; } eglDestroyContext(eglDisplay, s_globalShareContext); s_globalShareContext = EGL_NO_CONTEXT; - kwinApp()->platform()->setSceneEglGlobalShareContext(EGL_NO_CONTEXT); + kwinApp()->outputBackend()->setSceneEglGlobalShareContext(EGL_NO_CONTEXT); } void AbstractEglBackend::teardown() @@ -361,7 +361,7 @@ EGLContext AbstractEglBackend::createContextInternal(EGLContext sharedContext) void AbstractEglBackend::setEglDisplay(const EGLDisplay &display) { m_display = display; - kwinApp()->platform()->setSceneEglDisplay(display); + kwinApp()->outputBackend()->setSceneEglDisplay(display); } void AbstractEglBackend::setConfig(const EGLConfig &config) diff --git a/src/plugins/nightcolor/nightcolormanager.cpp b/src/plugins/nightcolor/nightcolormanager.cpp index 6e14def6e2..a81402b172 100644 --- a/src/plugins/nightcolor/nightcolormanager.cpp +++ b/src/plugins/nightcolor/nightcolormanager.cpp @@ -15,7 +15,7 @@ #include "nightcolorsettings.h" #include "suncalc.h" -#include +#include #include #include #include diff --git a/src/plugins/qpa/eglplatformcontext.cpp b/src/plugins/qpa/eglplatformcontext.cpp index 542c330472..ca510a3e19 100644 --- a/src/plugins/qpa/eglplatformcontext.cpp +++ b/src/plugins/qpa/eglplatformcontext.cpp @@ -9,7 +9,7 @@ */ #include "eglplatformcontext.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "eglhelpers.h" #include "internalwindow.h" #include "offscreensurface.h" @@ -33,7 +33,7 @@ namespace QPA EGLPlatformContext::EGLPlatformContext(QOpenGLContext *context, EGLDisplay display) : m_eglDisplay(display) { - create(context->format(), kwinApp()->platform()->sceneEglGlobalShareContext()); + create(context->format(), kwinApp()->outputBackend()->sceneEglGlobalShareContext()); } EGLPlatformContext::~EGLPlatformContext() diff --git a/src/plugins/qpa/integration.cpp b/src/plugins/qpa/integration.cpp index 13b6e0db26..97bfb0b8c4 100644 --- a/src/plugins/qpa/integration.cpp +++ b/src/plugins/qpa/integration.cpp @@ -16,7 +16,7 @@ #include "window.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "main.h" #include "workspace.h" @@ -148,11 +148,11 @@ QStringList Integration::themeNames() const QPlatformOpenGLContext *Integration::createPlatformOpenGLContext(QOpenGLContext *context) const { - if (kwinApp()->platform()->sceneEglGlobalShareContext() == EGL_NO_CONTEXT) { + if (kwinApp()->outputBackend()->sceneEglGlobalShareContext() == EGL_NO_CONTEXT) { qCWarning(KWIN_QPA) << "Attempting to create a QOpenGLContext before the scene is initialized"; return nullptr; } - const EGLDisplay eglDisplay = kwinApp()->platform()->sceneEglDisplay(); + const EGLDisplay eglDisplay = kwinApp()->outputBackend()->sceneEglDisplay(); if (eglDisplay != EGL_NO_DISPLAY) { EGLPlatformContext *platformContext = new EGLPlatformContext(context, eglDisplay); return platformContext; diff --git a/src/plugins/qpa/offscreensurface.cpp b/src/plugins/qpa/offscreensurface.cpp index 68c8ab5f60..392df72853 100644 --- a/src/plugins/qpa/offscreensurface.cpp +++ b/src/plugins/qpa/offscreensurface.cpp @@ -8,7 +8,7 @@ */ #include "offscreensurface.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "eglhelpers.h" #include "main.h" @@ -21,7 +21,7 @@ namespace QPA OffscreenSurface::OffscreenSurface(QOffscreenSurface *surface) : QPlatformOffscreenSurface(surface) - , m_eglDisplay(kwinApp()->platform()->sceneEglDisplay()) + , m_eglDisplay(kwinApp()->outputBackend()->sceneEglDisplay()) { const QSize size = surface->size(); diff --git a/src/plugins/qpa/window.cpp b/src/plugins/qpa/window.cpp index d3ead70528..c33e7bda80 100644 --- a/src/plugins/qpa/window.cpp +++ b/src/plugins/qpa/window.cpp @@ -8,7 +8,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "window.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "eglhelpers.h" #include "internalwindow.h" @@ -26,7 +26,7 @@ static quint32 s_windowId = 0; Window::Window(QWindow *window) : QPlatformWindow(window) - , m_eglDisplay(kwinApp()->platform()->sceneEglDisplay()) + , m_eglDisplay(kwinApp()->outputBackend()->sceneEglDisplay()) , m_windowId(++s_windowId) , m_scale(kwinApp()->devicePixelRatio()) { diff --git a/src/plugins/screencast/screencastmanager.cpp b/src/plugins/screencast/screencastmanager.cpp index 940aef9205..c58e106857 100644 --- a/src/plugins/screencast/screencastmanager.cpp +++ b/src/plugins/screencast/screencastmanager.cpp @@ -9,7 +9,7 @@ #include "screencastmanager.h" #include "composite.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "deleted.h" #include "effects.h" #include "kwingltexture.h" @@ -127,10 +127,10 @@ void ScreencastManager::streamVirtualOutput(KWaylandServer::ScreencastStreamV1In double scale, KWaylandServer::ScreencastV1Interface::CursorMode mode) { - auto output = kwinApp()->platform()->createVirtualOutput(name, size, scale); + auto output = kwinApp()->outputBackend()->createVirtualOutput(name, size, scale); streamOutput(stream, output, mode); connect(stream, &KWaylandServer::ScreencastStreamV1Interface::finished, output, [output] { - kwinApp()->platform()->removeVirtualOutput(output); + kwinApp()->outputBackend()->removeVirtualOutput(output); }); } diff --git a/src/plugins/screencast/screencaststream.cpp b/src/plugins/screencast/screencaststream.cpp index d2e421e7c6..23303372af 100644 --- a/src/plugins/screencast/screencaststream.cpp +++ b/src/plugins/screencast/screencaststream.cpp @@ -8,7 +8,7 @@ #include "screencaststream.h" #include "composite.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "core/renderbackend.h" #include "cursor.h" #include "dmabuftexture.h" @@ -159,9 +159,9 @@ void ScreenCastStream::onStreamParamChanged(void *data, uint32_t id, const struc } if (modifierProperty && (!pw->m_dmabufParams || !receivedModifiers.contains(pw->m_dmabufParams->modifier))) { if (modifierProperty->flags & SPA_POD_PROP_FLAG_DONT_FIXATE) { - pw->m_dmabufParams = kwinApp()->platform()->testCreateDmaBuf(pw->m_resolution, spaVideoFormatToDrmFormat(pw->videoFormat.format), receivedModifiers); + pw->m_dmabufParams = kwinApp()->outputBackend()->testCreateDmaBuf(pw->m_resolution, spaVideoFormatToDrmFormat(pw->videoFormat.format), receivedModifiers); } else { - pw->m_dmabufParams = kwinApp()->platform()->testCreateDmaBuf(pw->m_resolution, spaVideoFormatToDrmFormat(pw->videoFormat.format), {DRM_FORMAT_MOD_INVALID}); + pw->m_dmabufParams = kwinApp()->outputBackend()->testCreateDmaBuf(pw->m_resolution, spaVideoFormatToDrmFormat(pw->videoFormat.format), {DRM_FORMAT_MOD_INVALID}); } qCDebug(KWIN_SCREENCAST) << "Stream dmabuf modifiers received, offering our best suited modifier" << pw->m_dmabufParams.has_value(); @@ -187,7 +187,7 @@ void ScreenCastStream::onStreamAddBuffer(void *data, pw_buffer *buffer) if (spa_data[0].type != SPA_ID_INVALID && spa_data[0].type & (1 << SPA_DATA_DmaBuf)) { Q_ASSERT(stream->m_dmabufParams); - dmabuff = kwinApp()->platform()->createDmaBufTexture(*stream->m_dmabufParams); + dmabuff = kwinApp()->outputBackend()->createDmaBufTexture(*stream->m_dmabufParams); } if (dmabuff) { @@ -324,7 +324,7 @@ bool ScreenCastStream::createStream() // it could make sense to offer the same format as the source const auto format = m_source->hasAlphaChannel() ? SPA_VIDEO_FORMAT_BGRA : SPA_VIDEO_FORMAT_BGR; const int drmFormat = spaVideoFormatToDrmFormat(format); - m_hasDmaBuf = kwinApp()->platform()->testCreateDmaBuf(m_resolution, drmFormat, {DRM_FORMAT_MOD_INVALID}).has_value(); + m_hasDmaBuf = kwinApp()->outputBackend()->testCreateDmaBuf(m_resolution, drmFormat, {DRM_FORMAT_MOD_INVALID}).has_value(); m_modifiers = Compositor::self()->backend()->supportedFormats().value(drmFormat); char buffer[2048]; @@ -580,7 +580,7 @@ void ScreenCastStream::tryEnqueue(pw_buffer *buffer) // a corrupted buffer. if (Compositor::self()->scene()->supportsNativeFence()) { Q_ASSERT_X(eglGetCurrentContext(), "tryEnqueue", "no current context"); - m_pendingFence = new EGLNativeFence(kwinApp()->platform()->sceneEglDisplay()); + m_pendingFence = new EGLNativeFence(kwinApp()->outputBackend()->sceneEglDisplay()); if (!m_pendingFence->isValid()) { qCWarning(KWIN_SCREENCAST) << "Failed to create a native EGL fence"; glFinish(); diff --git a/src/scripting/desktopbackgrounditem.cpp b/src/scripting/desktopbackgrounditem.cpp index 712a153d84..56d5e05567 100644 --- a/src/scripting/desktopbackgrounditem.cpp +++ b/src/scripting/desktopbackgrounditem.cpp @@ -10,7 +10,7 @@ #if KWIN_BUILD_ACTIVITIES #include "activities.h" #endif -#include "core/platform.h" +#include "core/outputbackend.h" #include "main.h" #include "scripting_logging.h" #include "virtualdesktops.h" @@ -37,7 +37,7 @@ QString DesktopBackgroundItem::outputName() const void DesktopBackgroundItem::setOutputName(const QString &name) { - setOutput(kwinApp()->platform()->findOutput(name)); + setOutput(kwinApp()->outputBackend()->findOutput(name)); } Output *DesktopBackgroundItem::output() const diff --git a/src/scripting/v3/clientmodel.cpp b/src/scripting/v3/clientmodel.cpp index f6edcf3968..20899bc7f7 100644 --- a/src/scripting/v3/clientmodel.cpp +++ b/src/scripting/v3/clientmodel.cpp @@ -6,7 +6,7 @@ #include "clientmodel.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "virtualdesktops.h" #include "window.h" #include "workspace.h" @@ -186,7 +186,7 @@ QString ClientFilterModel::screenName() const void ClientFilterModel::setScreenName(const QString &screen) { - Output *output = kwinApp()->platform()->findOutput(screen); + Output *output = kwinApp()->outputBackend()->findOutput(screen); if (m_output != output) { m_output = output; Q_EMIT screenNameChanged(); diff --git a/src/wayland/outputmanagement_v2_interface.cpp b/src/wayland/outputmanagement_v2_interface.cpp index 060e23931a..2610e98658 100644 --- a/src/wayland/outputmanagement_v2_interface.cpp +++ b/src/wayland/outputmanagement_v2_interface.cpp @@ -10,8 +10,8 @@ #include "outputmanagement_v2_interface.h" #include "utils/common.h" +#include "core/outputbackend.h" #include "core/outputconfiguration.h" -#include "core/platform.h" #include "main.h" #include "workspace.h" @@ -205,7 +205,7 @@ void OutputConfigurationV2Interface::kde_output_configuration_v2_apply(Resource applied = true; - const auto allOutputs = kwinApp()->platform()->outputs(); + const auto allOutputs = kwinApp()->outputBackend()->outputs(); const bool allDisabled = !std::any_of(allOutputs.begin(), allOutputs.end(), [this](const auto &output) { return config.constChangeSet(output)->enabled; }); diff --git a/src/wayland_server.cpp b/src/wayland_server.cpp index 40969c470c..3c5e41130a 100644 --- a/src/wayland_server.cpp +++ b/src/wayland_server.cpp @@ -13,7 +13,7 @@ #include "backends/drm/drm_backend.h" #include "composite.h" #include "core/output.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "idle_inhibition.h" #include "inputpanelv1integration.h" #include "keyboard_input.h" @@ -548,12 +548,12 @@ void WaylandServer::initWorkspace() m_primary->setPrimaryOutput(primaryOutput ? primaryOutput->name() : QString()); }); - const auto availableOutputs = kwinApp()->platform()->outputs(); + const auto availableOutputs = kwinApp()->outputBackend()->outputs(); for (Output *output : availableOutputs) { handleOutputAdded(output); } - connect(kwinApp()->platform(), &Platform::outputAdded, this, &WaylandServer::handleOutputAdded); - connect(kwinApp()->platform(), &Platform::outputRemoved, this, &WaylandServer::handleOutputRemoved); + connect(kwinApp()->outputBackend(), &OutputBackend::outputAdded, this, &WaylandServer::handleOutputAdded); + connect(kwinApp()->outputBackend(), &OutputBackend::outputRemoved, this, &WaylandServer::handleOutputRemoved); const auto outputs = workspace()->outputs(); for (Output *output : outputs) { @@ -566,7 +566,7 @@ void WaylandServer::initWorkspace() initScreenLocker(); } - if (auto backend = qobject_cast(kwinApp()->platform())) { + if (auto backend = qobject_cast(kwinApp()->outputBackend())) { m_leaseManager = new KWaylandServer::DrmLeaseManagerV1(backend, m_display, m_display); } diff --git a/src/workspace.cpp b/src/workspace.cpp index bab270ad48..74fe6ba141 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -20,8 +20,8 @@ #include "appmenu.h" #include "atoms.h" #include "composite.h" +#include "core/outputbackend.h" #include "core/outputconfiguration.h" -#include "core/platform.h" #include "cursor.h" #include "dbusinterface.h" #include "deleted.h" @@ -208,8 +208,8 @@ void Workspace::init() connect(options, &Options::separateScreenFocusChanged, m_focusChain.get(), &FocusChain::setSeparateScreenFocus); m_focusChain->setSeparateScreenFocus(options->isSeparateScreenFocus()); - slotPlatformOutputsQueried(); - connect(kwinApp()->platform(), &Platform::outputsQueried, this, &Workspace::slotPlatformOutputsQueried); + slotOutputBackendOutputsQueried(); + connect(kwinApp()->outputBackend(), &OutputBackend::outputsQueried, this, &Workspace::slotOutputBackendOutputsQueried); // create VirtualDesktopManager and perform dependency injection VirtualDesktopManager *vds = VirtualDesktopManager::self(); @@ -613,7 +613,7 @@ std::shared_ptr parseMode(Output *output, const QJsonObject &modeInf bool Workspace::applyOutputConfiguration(const OutputConfiguration &config) { - if (!kwinApp()->platform()->applyOutputChanges(config)) { + if (!kwinApp()->outputBackend()->applyOutputChanges(config)) { return false; } updateOutputs(); @@ -627,7 +627,7 @@ void Workspace::updateOutputConfiguration() return; } - const auto outputs = kwinApp()->platform()->outputs(); + const auto outputs = kwinApp()->outputBackend()->outputs(); if (outputs.empty()) { // nothing to do return; @@ -690,7 +690,7 @@ void Workspace::updateOutputConfiguration() qCWarning(KWIN_CORE) << "KScreen config would disable the primary output!"; return; } - if (!kwinApp()->platform()->applyOutputChanges(cfg)) { + if (!kwinApp()->outputBackend()->applyOutputChanges(cfg)) { qCWarning(KWIN_CORE) << "Applying KScreen config failed!"; return; } @@ -1403,7 +1403,7 @@ Output *Workspace::outputAt(const QPointF &pos) const return bestOutput; } -void Workspace::slotPlatformOutputsQueried() +void Workspace::slotOutputBackendOutputsQueried() { if (waylandServer()) { updateOutputConfiguration(); @@ -1413,7 +1413,7 @@ void Workspace::slotPlatformOutputsQueried() void Workspace::updateOutputs() { - const auto availableOutputs = kwinApp()->platform()->outputs(); + const auto availableOutputs = kwinApp()->outputBackend()->outputs(); const auto oldOutputs = m_outputs; m_outputs.clear(); @@ -1742,9 +1742,9 @@ QString Workspace::supportInformation() const support.append(m_decorationBridge->supportInformation()); support.append(QStringLiteral("\n")); } - support.append(QStringLiteral("Platform\n")); - support.append(QStringLiteral("==========\n")); - support.append(kwinApp()->platform()->supportInformation()); + support.append(QStringLiteral("Output backend\n")); + support.append(QStringLiteral("==============\n")); + support.append(kwinApp()->outputBackend()->supportInformation()); support.append(QStringLiteral("\n")); const Cursor *cursor = Cursors::self()->mouse(); @@ -1792,7 +1792,7 @@ QString Workspace::supportInformation() const } else { support.append(QStringLiteral(" no\n")); } - const QVector outputs = kwinApp()->platform()->outputs(); + const QVector outputs = kwinApp()->outputBackend()->outputs(); support.append(QStringLiteral("Number of Screens: %1\n\n").arg(outputs.count())); for (int i = 0; i < outputs.count(); ++i) { const auto output = outputs[i]; diff --git a/src/workspace.h b/src/workspace.h index 3f4423007b..3709098ba5 100644 --- a/src/workspace.h +++ b/src/workspace.h @@ -547,7 +547,7 @@ private Q_SLOTS: void slotCurrentDesktopChangingCancelled(); void slotDesktopAdded(VirtualDesktop *desktop); void slotDesktopRemoved(VirtualDesktop *desktop); - void slotPlatformOutputsQueried(); + void slotOutputBackendOutputsQueried(); Q_SIGNALS: /** diff --git a/src/x11syncmanager.cpp b/src/x11syncmanager.cpp index 04cce69469..e6fc141a62 100644 --- a/src/x11syncmanager.cpp +++ b/src/x11syncmanager.cpp @@ -8,7 +8,7 @@ */ #include "x11syncmanager.h" #include "composite.h" -#include "core/platform.h" +#include "core/outputbackend.h" #include "core/renderbackend.h" #include "main.h" #include "scene.h"