backends/wayland: Avoid attaching null buffer

Otherwise the window will be unmapped.
This commit is contained in:
Vlad Zahorodnii 2024-05-16 15:38:33 +03:00
parent 0b2596b604
commit ebe6f58d9a

View file

@ -129,11 +129,13 @@ void WaylandEglPrimaryLayer::present()
{
const auto waylandOutput = static_cast<WaylandOutput *>(m_output);
KWayland::Client::Surface *surface = waylandOutput->surface();
surface->attachBuffer(m_presentationBuffer);
surface->damage(m_damageJournal.lastDamage());
surface->setScale(std::ceil(waylandOutput->scale()));
if (m_presentationBuffer) {
surface->attachBuffer(m_presentationBuffer);
surface->damage(m_damageJournal.lastDamage());
surface->setScale(std::ceil(waylandOutput->scale()));
m_presentationBuffer = nullptr;
}
surface->commit();
m_presentationBuffer = nullptr;
}
DrmDevice *WaylandEglPrimaryLayer::scanoutDevice() const