wayland: Simplify startup of compositor
At the moment, the wayland compositor has to handle the case of having no workspace. This should be unnecessary and it creates a pesky cycling dependency between Workspace and Compositor. Given that the Workspace acts more like a container and kwin starts accepting client connections after starting compositing, it's possible to create the Workspace earlier and simplify the start() function a bit.
This commit is contained in:
parent
de905d09f4
commit
15ed4f393e
3 changed files with 8 additions and 14 deletions
|
@ -146,6 +146,10 @@ void WaylandTestApplication::performStartup()
|
|||
createVirtualInputDevices();
|
||||
|
||||
WaylandCompositor::create();
|
||||
createWorkspace();
|
||||
createColorManager();
|
||||
createPlugins();
|
||||
|
||||
connect(Compositor::self(), &Compositor::sceneCreated, this, &WaylandTestApplication::continueStartupWithScene);
|
||||
}
|
||||
|
||||
|
@ -153,10 +157,6 @@ void WaylandTestApplication::continueStartupWithScene()
|
|||
{
|
||||
disconnect(Compositor::self(), &Compositor::sceneCreated, this, &WaylandTestApplication::continueStartupWithScene);
|
||||
|
||||
createWorkspace();
|
||||
createColorManager();
|
||||
createPlugins();
|
||||
|
||||
waylandServer()->initWorkspace();
|
||||
|
||||
if (!waylandServer()->start()) {
|
||||
|
|
|
@ -45,12 +45,7 @@ void WaylandCompositor::start()
|
|||
return;
|
||||
}
|
||||
|
||||
if (Workspace::self()) {
|
||||
startupWithWorkspace();
|
||||
} else {
|
||||
connect(kwinApp(), &Application::workspaceCreated,
|
||||
this, &WaylandCompositor::startupWithWorkspace);
|
||||
}
|
||||
startupWithWorkspace();
|
||||
}
|
||||
|
||||
} // namespace KWin
|
||||
|
|
|
@ -145,6 +145,9 @@ void ApplicationWayland::performStartup()
|
|||
createTabletModeManager();
|
||||
|
||||
WaylandCompositor::create();
|
||||
createWorkspace();
|
||||
createColorManager();
|
||||
createPlugins();
|
||||
|
||||
connect(Compositor::self(), &Compositor::sceneCreated, outputBackend(), &OutputBackend::sceneInitialized);
|
||||
connect(Compositor::self(), &Compositor::sceneCreated, this, &ApplicationWayland::continueStartupWithScene, Qt::SingleShotConnection);
|
||||
|
@ -153,10 +156,6 @@ void ApplicationWayland::performStartup()
|
|||
void ApplicationWayland::continueStartupWithScene()
|
||||
{
|
||||
// Note that we start accepting client connections after creating the Workspace.
|
||||
createWorkspace();
|
||||
createColorManager();
|
||||
createPlugins();
|
||||
|
||||
if (!waylandServer()->start()) {
|
||||
qFatal("Failed to initialze the Wayland server, exiting now");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue