From ebe6f58d9aaeee87e8143b76a9fcb3a50e42ca94 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 16 May 2024 15:38:33 +0300 Subject: [PATCH] backends/wayland: Avoid attaching null buffer Otherwise the window will be unmapped. --- src/backends/wayland/wayland_egl_backend.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/backends/wayland/wayland_egl_backend.cpp b/src/backends/wayland/wayland_egl_backend.cpp index 13f1023e6b..ba910c7117 100644 --- a/src/backends/wayland/wayland_egl_backend.cpp +++ b/src/backends/wayland/wayland_egl_backend.cpp @@ -129,11 +129,13 @@ void WaylandEglPrimaryLayer::present() { const auto waylandOutput = static_cast(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