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