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.
This commit is contained in:
parent
b11499d95e
commit
32daab286d
1 changed files with 2 additions and 2 deletions
|
@ -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());
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue