diff --git a/src/backends/drm/drm_backend.cpp b/src/backends/drm/drm_backend.cpp index 4d6efc69de..867a071c37 100644 --- a/src/backends/drm/drm_backend.cpp +++ b/src/backends/drm/drm_backend.cpp @@ -434,6 +434,7 @@ namespace KWinKScreenIntegration bool DrmBackend::readOutputsConfiguration(const QVector &outputs) { + Q_ASSERT(!outputs.isEmpty()); const auto outputsInfo = KWinKScreenIntegration::outputsConfig(outputs); AbstractWaylandOutput *primaryOutput = outputs.constFirst(); @@ -510,7 +511,7 @@ void DrmBackend::enableOutput(DrmAbstractOutput *output, bool enable) m_placeHolderOutput = nullptr; } } else { - if (m_enabledOutputs.count() == 1) { + if (m_enabledOutputs.count() == 1 && m_outputs.count() > 1) { auto outputs = m_outputs; outputs.removeOne(output); if (!readOutputsConfiguration(outputs)) {