diff options
author | Vaxry <[email protected]> | 2024-07-25 14:12:08 +0200 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-07-25 14:12:08 +0200 |
commit | a0d15a0b7b066cbb1b08ac54cf882c2c55467e4a (patch) | |
tree | 5611468dbb658cf2f8be7ca2be85fa1a018ab9d7 | |
parent | cd942ad12d9d2030963e3dd5fbfe2d181013c750 (diff) | |
download | Hyprland-a0d15a0b7b066cbb1b08ac54cf882c2c55467e4a.tar.gz Hyprland-a0d15a0b7b066cbb1b08ac54cf882c2c55467e4a.zip |
wayland/compositor: release buffers on unmap
XWayland does not use the regular commit(null) method to unmap, which results in buffers never being released.
release the buffers if present and un-released in the unmap() handler
ref #6584
-rw-r--r-- | src/protocols/core/Compositor.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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) { |