Commit 32daab28 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Use workspaceLayer as context object

Otherwise the connection isn't severed when the layer is destroyed,
leading to crashes when screen resolution changes.

We don't actually need `this` to access `workspace()`, and we have
a guarded `output` as sender in the other case.
parent b11499d9
Pipeline #145205 passed with stage
in 15 minutes
......@@ -365,7 +365,7 @@ void Compositor::startupWithWorkspace()
auto workspaceLayer = new RenderLayer(outputs.constFirst()->renderLoop());
workspaceLayer->setDelegate(new SceneDelegate(m_scene));
workspaceLayer->setGeometry(workspace()->geometry());
connect(workspace(), &Workspace::geometryChanged, this, [workspaceLayer]() {
connect(workspace(), &Workspace::geometryChanged, workspaceLayer, [workspaceLayer]() {
workspaceLayer->setGeometry(workspace()->geometry());
});
addSuperLayer(workspaceLayer);
......@@ -424,7 +424,7 @@ void Compositor::addOutput(AbstractOutput *output)
auto workspaceLayer = new RenderLayer(output->renderLoop());
workspaceLayer->setDelegate(new SceneDelegate(m_scene, output));
workspaceLayer->setGeometry(output->geometry());
connect(output, &AbstractOutput::geometryChanged, this, [output, workspaceLayer]() {
connect(output, &AbstractOutput::geometryChanged, workspaceLayer, [output, workspaceLayer]() {
workspaceLayer->setGeometry(output->geometry());
});
......
Supports Markdown
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