From b7d7a99fcb1a3560bae36f2843439189fdbd4312 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Tue, 26 Jul 2022 00:00:02 +0200 Subject: [PATCH] backends/drm: fix placeholder output check Non-desktop outputs must be ignored --- src/backends/drm/drm_backend.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/backends/drm/drm_backend.cpp b/src/backends/drm/drm_backend.cpp index 86c6569e27..321d1b9623 100644 --- a/src/backends/drm/drm_backend.cpp +++ b/src/backends/drm/drm_backend.cpp @@ -537,14 +537,17 @@ void DrmBackend::enableOutput(DrmAbstractOutput *output, bool enable) m_enabledOutputs << output; Q_EMIT outputEnabled(output); checkOutputsAreOn(); - if (m_placeHolderOutput) { + if (m_placeHolderOutput && !output->isNonDesktop()) { qCDebug(KWIN_DRM) << "removing placeholder output"; primaryGpu()->removeVirtualOutput(m_placeHolderOutput); m_placeHolderOutput = nullptr; m_placeholderFilter.reset(); } } else { - if (m_enabledOutputs.count() == 1 && !kwinApp()->isTerminating()) { + int normalOutputsCount = std::count_if(m_enabledOutputs.begin(), m_enabledOutputs.end(), [](const auto output) { + return !output->isNonDesktop(); + }); + if (normalOutputsCount == 1 && !output->isNonDesktop() && !kwinApp()->isTerminating()) { qCDebug(KWIN_DRM) << "adding placeholder output"; m_placeHolderOutput = primaryGpu()->createVirtualOutput({}, m_enabledOutputs.constFirst()->pixelSize(), 1, DrmVirtualOutput::Type::Placeholder); // placeholder doesn't actually need to render anything