diff options
author | Vaxry <[email protected]> | 2024-08-07 13:35:02 +0200 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-08-07 13:35:02 +0200 |
commit | f36c625e37f8913d8da38365a4783948f2217f02 (patch) | |
tree | 1136dc6e26d6b61f4ce40eb5cf6ce7c0f45b682e | |
parent | 2e3dc17a7e56c609659514af13ce911481334be3 (diff) | |
download | Hyprland-f36c625e37f8913d8da38365a4783948f2217f02.tar.gz Hyprland-f36c625e37f8913d8da38365a4783948f2217f02.zip |
compositor: minor cleanups for fading out layers
-rw-r--r-- | src/Compositor.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 299a16c6..9b8fd3d7 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1425,12 +1425,16 @@ void CCompositor::cleanupFadingOut(const int& monid) { } } + bool layersDirty = false; + for (auto& lsr : m_vSurfacesFadingOut) { auto ls = lsr.lock(); - if (!ls) + if (!ls) { + layersDirty = true; continue; + } if (ls->monitorID != monid) continue; @@ -1443,7 +1447,7 @@ void CCompositor::cleanupFadingOut(const int& monid) { for (auto& m : m_vMonitors) { for (auto& lsl : m->m_aLayerSurfaceLayers) { if (!lsl.empty() && std::find_if(lsl.begin(), lsl.end(), [&](auto& other) { return other == ls; }) != lsl.end()) { - std::erase_if(lsl, [&](auto& other) { return other == ls; }); + std::erase_if(lsl, [&](auto& other) { return other == ls || !other; }); } } } @@ -1459,6 +1463,9 @@ void CCompositor::cleanupFadingOut(const int& monid) { return; } } + + if (layersDirty) + std::erase_if(m_vSurfacesFadingOut, [](const auto& el) { return el.expired(); }); } void CCompositor::addToFadingOutSafe(PHLLS pLS) { |