From e09ca742958dd8b977bebb936680b19f1fa86e44 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 12 Jul 2022 12:23:39 +0300 Subject: [PATCH] wayland: Make workspace responsible for creating Screens The Screens object is created by Workspace on X11. This change makes X11 and Wayland behave more similar. As is, the Screens is a helper for window management code, don't use it in backends. Note that the X11 backend already uses the Screens, it needs to be addressed individually. --- autotests/integration/kwin_wayland_test.cpp | 1 - src/main.cpp | 12 +----------- src/main.h | 2 -- src/main_wayland.cpp | 1 - src/workspace.cpp | 2 +- 5 files changed, 2 insertions(+), 16 deletions(-) diff --git a/autotests/integration/kwin_wayland_test.cpp b/autotests/integration/kwin_wayland_test.cpp index a65512ae0d..7a45d3240c 100644 --- a/autotests/integration/kwin_wayland_test.cpp +++ b/autotests/integration/kwin_wayland_test.cpp @@ -153,7 +153,6 @@ void WaylandTestApplication::performStartup() void WaylandTestApplication::continueStartupWithScreens() { disconnect(kwinApp()->platform(), &Platform::screensQueried, this, &WaylandTestApplication::continueStartupWithScreens); - createScreens(); WaylandCompositor::create(); connect(Compositor::self(), &Compositor::sceneCreated, this, &WaylandTestApplication::continueStartupWithScene); } diff --git a/src/main.cpp b/src/main.cpp index 3320790be3..384a3bf242 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,15 +12,14 @@ #include #include "atoms.h" -#include "platform.h" #include "colormanager.h" #include "composite.h" #include "cursor.h" #include "input.h" #include "inputmethod.h" #include "options.h" +#include "platform.h" #include "pluginmanager.h" -#include "screens.h" #if KWIN_BUILD_SCREENLOCKER #include "screenlockerwatcher.h" #endif @@ -280,15 +279,6 @@ void Application::createInput() m_platform->createPlatformCursor(this); } -void Application::createScreens() -{ - if (Screens::self()) { - return; - } - Screens::create(this); - Q_EMIT screensCreated(); -} - void Application::createAtoms() { atoms = new Atoms; diff --git a/src/main.h b/src/main.h index aaef36320f..ac9a9f9286 100644 --- a/src/main.h +++ b/src/main.h @@ -138,7 +138,6 @@ public: } } void updateX11Time(xcb_generic_event_t *event); - void createScreens(); static void setCrashCount(int count); static bool wasCrash(); @@ -238,7 +237,6 @@ Q_SIGNALS: void x11ConnectionAboutToBeDestroyed(); void xwaylandScaleChanged(); void workspaceCreated(); - void screensCreated(); void platformCreated(); void virtualTerminalCreated(); void started(); diff --git a/src/main_wayland.cpp b/src/main_wayland.cpp index 3725c9adf9..5de72da904 100644 --- a/src/main_wayland.cpp +++ b/src/main_wayland.cpp @@ -149,7 +149,6 @@ void ApplicationWayland::performStartup() TabletModeManager::create(this); createPlugins(); - createScreens(); WaylandCompositor::create(); connect(Compositor::self(), &Compositor::sceneCreated, platform(), &Platform::sceneInitialized); diff --git a/src/workspace.cpp b/src/workspace.cpp index 7e392df736..07a8177577 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -157,7 +157,7 @@ Workspace::Workspace() RuleBook::create(this)->load(); - kwinApp()->createScreens(); + Screens::create(this); ScreenEdges::create(this); // VirtualDesktopManager needs to be created prior to init shortcuts