backends/drm: don't read configuration of zero outputs
Doesn't make any sense and can cause crashes
This commit is contained in:
parent
d67a0b006a
commit
b0173c236c
1 changed files with 2 additions and 1 deletions
|
@ -434,6 +434,7 @@ namespace KWinKScreenIntegration
|
||||||
|
|
||||||
bool DrmBackend::readOutputsConfiguration(const QVector<DrmAbstractOutput*> &outputs)
|
bool DrmBackend::readOutputsConfiguration(const QVector<DrmAbstractOutput*> &outputs)
|
||||||
{
|
{
|
||||||
|
Q_ASSERT(!outputs.isEmpty());
|
||||||
const auto outputsInfo = KWinKScreenIntegration::outputsConfig(outputs);
|
const auto outputsInfo = KWinKScreenIntegration::outputsConfig(outputs);
|
||||||
|
|
||||||
AbstractWaylandOutput *primaryOutput = outputs.constFirst();
|
AbstractWaylandOutput *primaryOutput = outputs.constFirst();
|
||||||
|
@ -510,7 +511,7 @@ void DrmBackend::enableOutput(DrmAbstractOutput *output, bool enable)
|
||||||
m_placeHolderOutput = nullptr;
|
m_placeHolderOutput = nullptr;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (m_enabledOutputs.count() == 1) {
|
if (m_enabledOutputs.count() == 1 && m_outputs.count() > 1) {
|
||||||
auto outputs = m_outputs;
|
auto outputs = m_outputs;
|
||||||
outputs.removeOne(output);
|
outputs.removeOne(output);
|
||||||
if (!readOutputsConfiguration(outputs)) {
|
if (!readOutputsConfiguration(outputs)) {
|
||||||
|
|
Loading…
Reference in a new issue