This commit is contained in:
vaxerski 2022-07-20 19:26:15 +02:00
parent 3b7ae83323
commit 0ad0bb2819

View file

@ -101,6 +101,9 @@ void Events::listener_mapLayerSurface(void* owner, void* data) {
layersurface->layerSurface->mapped = true; 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 // fix if it changed its mon
const auto PMONITOR = g_pCompositor->getMonitorFromOutput(layersurface->layerSurface->output); const auto PMONITOR = g_pCompositor->getMonitorFromOutput(layersurface->layerSurface->output);
@ -148,6 +151,8 @@ void Events::listener_unmapLayerSurface(void* owner, void* data) {
return; return;
} }
layersurface->hyprListener_commitLayerSurface.removeCallback();
// make a snapshot and start fade // make a snapshot and start fade
g_pHyprOpenGL->makeLayerSnapshot(layersurface); g_pHyprOpenGL->makeLayerSnapshot(layersurface);
layersurface->alpha = 0.f; layersurface->alpha = 0.f;