backends/drm: fix output changes with the placeholder output
As the placeholder output gets added or removed in response to other outputs getting enabled or disabled, the output list may change while iterating over them and applying changes. BUG: 448454 BUG: 448474 CCBUG: 448697 FIXED-IN: 5.24
This commit is contained in:
parent
2cf6fc82c4
commit
e0a8fa778e
1 changed files with 7 additions and 3 deletions
|
@ -632,10 +632,14 @@ bool DrmBackend::applyOutputChanges(const WaylandOutputConfig &config)
|
|||
return false;
|
||||
}
|
||||
}
|
||||
// first, apply changes to drm outputs.
|
||||
// This may remove the placeholder output and thus change m_outputs!
|
||||
for (const auto &output : qAsConst(changed)) {
|
||||
output->applyQueuedChanges(config);
|
||||
}
|
||||
// only then apply changes to the virtual outputs
|
||||
for (const auto &output : qAsConst(m_outputs)) {
|
||||
if (auto drmOutput = qobject_cast<DrmOutput*>(output)) {
|
||||
drmOutput->applyQueuedChanges(config);
|
||||
} else {
|
||||
if (!qobject_cast<DrmOutput*>(output)) {
|
||||
output->applyChanges(config);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue