diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 3020b96d..9419583e 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1441,9 +1441,6 @@ void CCompositor::cleanupFadingOut(const int& monid) { g_pHyprOpenGL->markBlurDirtyForMonitor(getMonitorFromID(monid)); if (ls->fadingOut && ls->readyToDelete && !ls->alpha.isBeingAnimated()) { - g_pHyprOpenGL->m_mLayerFramebuffers[ls].release(); - g_pHyprOpenGL->m_mLayerFramebuffers.erase(ls); - for (auto& m : m_vMonitors) { for (auto& lsl : m->m_aLayerSurfaceLayers) { if (!lsl.empty() && std::find_if(lsl.begin(), lsl.end(), [&](std::unique_ptr& other) { return other.get() == ls; }) != lsl.end()) { diff --git a/src/helpers/WLClasses.cpp b/src/helpers/WLClasses.cpp index 6923d6a5..9a326614 100644 --- a/src/helpers/WLClasses.cpp +++ b/src/helpers/WLClasses.cpp @@ -8,6 +8,11 @@ SLayerSurface::SLayerSurface() { alpha.registerVar(); } +SLayerSurface::~SLayerSurface() { + g_pHyprRenderer->makeEGLCurrent(); + std::erase_if(g_pHyprOpenGL->m_mLayerFramebuffers, [&](const auto& other) { return other.first == this; }); +} + void SLayerSurface::applyRules() { noAnimations = false; forceBlur = false; diff --git a/src/helpers/WLClasses.hpp b/src/helpers/WLClasses.hpp index f7efbe98..d381fa0d 100644 --- a/src/helpers/WLClasses.hpp +++ b/src/helpers/WLClasses.hpp @@ -16,6 +16,7 @@ struct SLayerRule { struct SLayerSurface { SLayerSurface(); + ~SLayerSurface(); void applyRules();