From 0ad0bb2819a0dcfbb3a8910b6b86d1f91c559857 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 20 Jul 2022 19:26:15 +0200 Subject: [PATCH] 10 --- src/events/Layers.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/events/Layers.cpp b/src/events/Layers.cpp index af197168..0cac38a2 100644 --- a/src/events/Layers.cpp +++ b/src/events/Layers.cpp @@ -101,6 +101,9 @@ void Events::listener_mapLayerSurface(void* owner, void* data) { layersurface->layerSurface->mapped = true; + if (!layersurface->hyprListener_commitLayerSurface.isConnected()) + layersurface->hyprListener_commitLayerSurface.initCallback(&layersurface->layerSurface->surface->events.commit, &Events::listener_commitLayerSurface, layersurface, "layerSurface"); + // fix if it changed its mon const auto PMONITOR = g_pCompositor->getMonitorFromOutput(layersurface->layerSurface->output); @@ -148,6 +151,8 @@ void Events::listener_unmapLayerSurface(void* owner, void* data) { return; } + layersurface->hyprListener_commitLayerSurface.removeCallback(); + // make a snapshot and start fade g_pHyprOpenGL->makeLayerSnapshot(layersurface); layersurface->alpha = 0.f;