mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 03:05:59 +01:00
layer-shell: properly map and unmap surface and propagate unmap events
This commit is contained in:
parent
729b47d46d
commit
0243271544
3 changed files with 7 additions and 0 deletions
|
@ -119,6 +119,8 @@ void CLayerSurface::onMap() {
|
||||||
mapped = true;
|
mapped = true;
|
||||||
interactivity = layerSurface->current.interactivity;
|
interactivity = layerSurface->current.interactivity;
|
||||||
|
|
||||||
|
layerSurface->surface->map();
|
||||||
|
|
||||||
// this layer might be re-mapped.
|
// this layer might be re-mapped.
|
||||||
fadingOut = false;
|
fadingOut = false;
|
||||||
g_pCompositor->removeFromFadingOutSafe(self.lock());
|
g_pCompositor->removeFromFadingOutSafe(self.lock());
|
||||||
|
@ -190,6 +192,7 @@ void CLayerSurface::onUnmap() {
|
||||||
g_pCompositor->addToFadingOutSafe(self.lock());
|
g_pCompositor->addToFadingOutSafe(self.lock());
|
||||||
|
|
||||||
mapped = false;
|
mapped = false;
|
||||||
|
layerSurface->surface->unmap();
|
||||||
|
|
||||||
startAnimation(false);
|
startAnimation(false);
|
||||||
return;
|
return;
|
||||||
|
@ -201,6 +204,7 @@ void CLayerSurface::onUnmap() {
|
||||||
startAnimation(false);
|
startAnimation(false);
|
||||||
|
|
||||||
mapped = false;
|
mapped = false;
|
||||||
|
layerSurface->surface->unmap();
|
||||||
|
|
||||||
g_pCompositor->addToFadingOutSafe(self.lock());
|
g_pCompositor->addToFadingOutSafe(self.lock());
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,8 @@ CLayerShellResource::CLayerShellResource(SP<CZwlrLayerSurfaceV1> resource_, SP<C
|
||||||
PROTO::layerShell->destroyResource(this);
|
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) {
|
listeners.commitSurface = surf_->events.commit.registerListener([this](std::any d) {
|
||||||
current = pending;
|
current = pending;
|
||||||
pending.committed = 0;
|
pending.committed = 0;
|
||||||
|
|
|
@ -70,6 +70,7 @@ class CLayerShellResource : public ISurfaceRole {
|
||||||
struct {
|
struct {
|
||||||
CHyprSignalListener commitSurface;
|
CHyprSignalListener commitSurface;
|
||||||
CHyprSignalListener destroySurface;
|
CHyprSignalListener destroySurface;
|
||||||
|
CHyprSignalListener unmapSurface;
|
||||||
} listeners;
|
} listeners;
|
||||||
|
|
||||||
bool closed = false;
|
bool closed = false;
|
||||||
|
|
Loading…
Reference in a new issue