diff --git a/src/protocols/core/Compositor.cpp b/src/protocols/core/Compositor.cpp index f1c83531..a31b1fb4 100644 --- a/src/protocols/core/Compositor.cpp +++ b/src/protocols/core/Compositor.cpp @@ -336,6 +336,17 @@ void CWLSurfaceResource::unmap() { mapped = false; events.unmap.emit(); + + // release the buffers. + // this is necessary for XWayland to function correctly, + // as it does not unmap via the traditional commit(null buffer) method, but via the X11 protocol. + if (!bufferReleased && current.buffer) + current.buffer->sendRelease(); + if (pending.buffer) + pending.buffer->sendRelease(); + + pending.buffer.reset(); + current.buffer.reset(); } void CWLSurfaceResource::error(int code, const std::string& str) {