diff options
author | vaxerski <[email protected]> | 2022-07-25 18:38:40 +0200 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-07-25 18:38:40 +0200 |
commit | b1d3a1deeaabe7b8de7f6fe908b0d57934f3dfeb (patch) | |
tree | 43d6cd9e2f78bf98cd003b89fe6481d63e037228 | |
parent | e2594c79cc33dc3465589778b6d4020f7dbadace (diff) | |
download | Hyprland-b1d3a1deeaabe7b8de7f6fe908b0d57934f3dfeb.tar.gz Hyprland-b1d3a1deeaabe7b8de7f6fe908b0d57934f3dfeb.zip |
force unmap on direct destroy
-rw-r--r-- | src/events/Layers.cpp | 16 | ||||
-rw-r--r-- | src/helpers/WLClasses.hpp | 2 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/events/Layers.cpp b/src/events/Layers.cpp index 871e118d..50b9b504 100644 --- a/src/events/Layers.cpp +++ b/src/events/Layers.cpp @@ -67,10 +67,15 @@ void Events::listener_destroyLayerSurface(void* owner, void* data) { Debug::log(WARN, "Layersurface destroyed on an invalid monitor (removed?)"); if (!layersurface->fadingOut && PMONITOR) { - Debug::log(LOG, "Removing LayerSurface that wasn't mapped."); - layersurface->alpha.setValueAndWarp(0.f); - layersurface->fadingOut = true; - g_pCompositor->m_vSurfacesFadingOut.push_back(layersurface); + if (layersurface->mapped) { + Debug::log(LOG, "Forcing an unmap of a LS that did a straight destroy!"); + listener_unmapLayerSurface(layersurface, nullptr); + } else { + Debug::log(LOG, "Removing LayerSurface that wasn't mapped."); + layersurface->alpha.setValueAndWarp(0.f); + layersurface->fadingOut = true; + g_pCompositor->m_vSurfacesFadingOut.push_back(layersurface); + } } layersurface->noProcess = true; @@ -101,6 +106,7 @@ void Events::listener_mapLayerSurface(void* owner, void* data) { Debug::log(LOG, "LayerSurface %x mapped", layersurface->layerSurface); layersurface->layerSurface->mapped = true; + layersurface->mapped = true; // fix if it changed its mon const auto PMONITOR = g_pCompositor->getMonitorFromOutput(layersurface->layerSurface->output); @@ -158,6 +164,8 @@ void Events::listener_unmapLayerSurface(void* owner, void* data) { g_pHyprOpenGL->makeLayerSnapshot(layersurface); layersurface->alpha = 0.f; + layersurface->mapped = false; + layersurface->fadingOut = true; g_pCompositor->m_vSurfacesFadingOut.push_back(layersurface); diff --git a/src/helpers/WLClasses.hpp b/src/helpers/WLClasses.hpp index 8df11bcd..65b18211 100644 --- a/src/helpers/WLClasses.hpp +++ b/src/helpers/WLClasses.hpp @@ -23,6 +23,8 @@ struct SLayerSurface { Vector2D position; zwlr_layer_shell_v1_layer layer; + bool mapped = false; + int monitorID = -1; std::string szNamespace = ""; |