From f8e0b0b448b8b68f65ee1c3eebdd4eb3e3382138 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 5 Apr 2022 19:28:10 +0200 Subject: fadein and prep for fadeout --- src/Compositor.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/Compositor.cpp') diff --git a/src/Compositor.cpp b/src/Compositor.cpp index bf36bf89..7fdd65bc 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -230,7 +230,7 @@ SMonitor* CCompositor::getMonitorFromVector(const Vector2D& point) { } void CCompositor::removeWindowFromVectorSafe(CWindow* pWindow) { - if (windowExists(pWindow)) + if (windowExists(pWindow) && !pWindow->m_bFadingOut) m_lWindows.remove(*pWindow); } @@ -552,4 +552,15 @@ void CCompositor::moveWindowToTop(CWindow* pWindow) { break; } } +} + +void CCompositor::cleanupWindows() { + for (auto& w : m_lWindowsFadingOut) { + if (!w->m_bFadingOut || w->m_fAlpha == 0.f) { + m_lWindows.remove(*w); + m_lWindowsFadingOut.remove(w); + Debug::log(LOG, "Cleanup: cleaned up a window"); + return; + } + } } \ No newline at end of file -- cgit v1.2.3