backends/drm: make the placeholder screen as big as the last screen

The fixed size of 1080p makes windows change their size and place. To
prevent that from happening, make the placeholder screen the same size
as the last disconnected screen.
This is not a bullet proof solution, only a fast one. Ideally KWin
should remember the window layout on a given monitor setup and restore
it when reconnected.

BUG: 447419
FIXED-IN: 5.24
This commit is contained in:
Xaver Hugl 2022-01-02 23:58:31 +01:00
parent bc3d80db2a
commit 5a6f1e42c1

View file

@ -501,7 +501,7 @@ void DrmBackend::enableOutput(DrmAbstractOutput *output, bool enable)
}
if (m_enabledOutputs.count() == 1 && !kwinApp()->isTerminating()) {
qCDebug(KWIN_DRM) << "adding placeholder output";
m_placeHolderOutput = primaryGpu()->createVirtualOutput({}, {1920, 1080}, 1, DrmGpu::Placeholder);
m_placeHolderOutput = primaryGpu()->createVirtualOutput({}, m_enabledOutputs.constFirst()->pixelSize(), 1, DrmGpu::Placeholder);
// placeholder doesn't actually need to render anything
m_placeHolderOutput->renderLoop()->inhibit();
}