mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 15:45:59 +01:00
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
This commit is contained in:
parent
cd942ad12d
commit
a0d15a0b7b
1 changed files with 11 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue