Commit 7d007666 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

backends/drm: Make drm backend not touch output configuration if all outputs are disabled

This behavior was added in order to fix a crash reported in bug report
442990. However, the analysis was not 100% correct, kwin failed to
create a placeholder because the relevant check was incorrect. The drm
backend was checking the list of all connected outputs rather than the
list with enabled outputs to decide whether to create a placeholder output.

As a safety measure the proposed behavior makes sense, however the drm
backend is not the right layer to implement it. If the last enabled
output is disconnected, kscreen should view it as a new output
setup and re-enable outputs in order to ask user what desired output
configuration should be.
parent 694c32cf
Pipeline #203255 passed with stage
in 35 minutes and 9 seconds
......@@ -533,18 +533,6 @@ void DrmBackend::enableOutput(DrmAbstractOutput *output, bool enable)
} else {
if (m_enabledOutputs.count() == 1 && m_outputs.count() > 1 && !kwinApp()->isTerminating()) {
auto outputs = m_outputs;
if (!readOutputsConfiguration(outputs)) {
// config is invalid or failed to apply -> Try to enable an output anyways
OutputConfiguration cfg;
cfg.changeSet(outputs.constFirst())->enabled = true;
if (!applyOutputChanges(cfg)) {
qCCritical(KWIN_DRM) << "Could not enable any outputs!";
if (m_enabledOutputs.count() == 1 && !kwinApp()->isTerminating()) {
qCDebug(KWIN_DRM) << "adding placeholder output";
m_placeHolderOutput = primaryGpu()->createVirtualOutput({}, m_enabledOutputs.constFirst()->pixelSize(), 1, DrmVirtualOutput::Type::Placeholder);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment