platforms/drm: handle hotplugs with disabled outputs better
If the last enabled output gets removed but we have disabled outputs still connected, enable the first disabled output to prevent a crash. BUG: 442990
This commit is contained in:
parent
85fb0e7c43
commit
178e69b39b
1 changed files with 8 additions and 0 deletions
|
@ -332,6 +332,14 @@ void DrmBackend::removeOutput(DrmAbstractOutput *o)
|
|||
m_placeHolderOutput->renderLoop()->inhibit();
|
||||
}
|
||||
if (m_enabledOutputs.contains(o)) {
|
||||
if (m_enabledOutputs.count() == 1) {
|
||||
for (const auto &output : qAsConst(m_outputs)) {
|
||||
if (output != o) {
|
||||
output->setEnabled(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
m_enabledOutputs.removeOne(o);
|
||||
Q_EMIT outputDisabled(o);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue