Commit d75e5c63 authored by Martin Flöser's avatar Martin Flöser

Ensure Workspace is only started once in Wayland-only mode

The connect to Compositor::sceneCreated must be disconnected again,
otherwise a restart of the Compositor results in Workspace being created
again.

Thanks to our autotests for finding this problem!
parent f0445b20
......@@ -119,17 +119,19 @@ void WaylandTestApplication::continueStartupWithScreens()
if (operationMode() == OperationModeWaylandOnly) {
createCompositor();
connect(Compositor::self(), &Compositor::sceneCreated, this,
[this] {
createWorkspace();
}
);
connect(Compositor::self(), &Compositor::sceneCreated, this, &WaylandTestApplication::continueStartupWithSceen);
return;
}
createCompositor();
connect(Compositor::self(), &Compositor::sceneCreated, this, &WaylandTestApplication::startXwaylandServer);
}
void WaylandTestApplication::continueStartupWithSceen()
{
disconnect(Compositor::self(), &Compositor::sceneCreated, this, &WaylandTestApplication::continueStartupWithSceen);
createWorkspace();
}
void WaylandTestApplication::continueStartupWithX()
{
createX11Connection();
......
......@@ -64,6 +64,7 @@ private:
void createBackend();
void createX11Connection();
void continueStartupWithScreens();
void continueStartupWithSceen();
void continueStartupWithX();
void startXwaylandServer();
......
......@@ -162,19 +162,21 @@ void ApplicationWayland::continueStartupWithScreens()
if (operationMode() == OperationModeWaylandOnly) {
createCompositor();
connect(Compositor::self(), &Compositor::sceneCreated, this,
[this] {
startSession();
createWorkspace();
notifyKSplash();
}
);
connect(Compositor::self(), &Compositor::sceneCreated, this, &ApplicationWayland::continueStartupWithSceen);
return;
}
createCompositor();
connect(Compositor::self(), &Compositor::sceneCreated, this, &ApplicationWayland::startXwaylandServer);
}
void ApplicationWayland::continueStartupWithSceen()
{
disconnect(Compositor::self(), &Compositor::sceneCreated, this, &ApplicationWayland::continueStartupWithSceen);
startSession();
createWorkspace();
notifyKSplash();
}
void ApplicationWayland::continueStartupWithX()
{
createX11Connection();
......
......@@ -61,6 +61,7 @@ private:
void createBackend();
void createX11Connection();
void continueStartupWithScreens();
void continueStartupWithSceen();
void continueStartupWithX();
void startXwaylandServer();
void startSession();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment