diff options
author | vaxerski <[email protected]> | 2024-07-27 18:08:22 +0200 |
---|---|---|
committer | vaxerski <[email protected]> | 2024-07-27 18:08:22 +0200 |
commit | 024327154425c76a2932d644d76990a00b5fcdac (patch) | |
tree | c1639764bb134bf9d3e5e160271e07c223d8ce2a | |
parent | 729b47d46d0c749efbffe01ea863a124fad562b4 (diff) | |
download | Hyprland-024327154425c76a2932d644d76990a00b5fcdac.tar.gz Hyprland-024327154425c76a2932d644d76990a00b5fcdac.zip |
layer-shell: properly map and unmap surface and propagate unmap events
-rw-r--r-- | src/desktop/LayerSurface.cpp | 4 | ||||
-rw-r--r-- | src/protocols/LayerShell.cpp | 2 | ||||
-rw-r--r-- | src/protocols/LayerShell.hpp | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/src/desktop/LayerSurface.cpp b/src/desktop/LayerSurface.cpp index 2252adca..f3db4b61 100644 --- a/src/desktop/LayerSurface.cpp +++ b/src/desktop/LayerSurface.cpp @@ -119,6 +119,8 @@ void CLayerSurface::onMap() { mapped = true; interactivity = layerSurface->current.interactivity; + layerSurface->surface->map(); + // this layer might be re-mapped. fadingOut = false; g_pCompositor->removeFromFadingOutSafe(self.lock()); @@ -190,6 +192,7 @@ void CLayerSurface::onUnmap() { g_pCompositor->addToFadingOutSafe(self.lock()); mapped = false; + layerSurface->surface->unmap(); startAnimation(false); return; @@ -201,6 +204,7 @@ void CLayerSurface::onUnmap() { startAnimation(false); mapped = false; + layerSurface->surface->unmap(); g_pCompositor->addToFadingOutSafe(self.lock()); diff --git a/src/protocols/LayerShell.cpp b/src/protocols/LayerShell.cpp index 4e733b35..e018c3d0 100644 --- a/src/protocols/LayerShell.cpp +++ b/src/protocols/LayerShell.cpp @@ -38,6 +38,8 @@ CLayerShellResource::CLayerShellResource(SP<CZwlrLayerSurfaceV1> resource_, SP<C PROTO::layerShell->destroyResource(this); }); + listeners.unmapSurface = surf_->events.unmap.registerListener([this](std::any d) { events.unmap.emit(); }); + listeners.commitSurface = surf_->events.commit.registerListener([this](std::any d) { current = pending; pending.committed = 0; diff --git a/src/protocols/LayerShell.hpp b/src/protocols/LayerShell.hpp index 221d95c0..ee0b7859 100644 --- a/src/protocols/LayerShell.hpp +++ b/src/protocols/LayerShell.hpp @@ -70,6 +70,7 @@ class CLayerShellResource : public ISurfaceRole { struct { CHyprSignalListener commitSurface; CHyprSignalListener destroySurface; + CHyprSignalListener unmapSurface; } listeners; bool closed = false; |