From 1a4e6e6a4b3272118a51bebb4a45ecd642383209 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Mon, 5 Jun 2023 09:49:17 +0200 Subject: [PATCH] window: recalc on deco remove --- src/Window.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Window.cpp b/src/Window.cpp index a1746fbc..ce3ee967 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -145,16 +145,22 @@ void CWindow::updateWindowDecos() { for (auto& wd : m_dWindowDecorations) wd->updateWindow(this); + bool recalc = false; + for (auto& wd : m_vDecosToRemove) { for (auto it = m_dWindowDecorations.begin(); it != m_dWindowDecorations.end(); it++) { if (it->get() == wd) { - it = m_dWindowDecorations.erase(it); + it = m_dWindowDecorations.erase(it); + recalc = true; if (it == m_dWindowDecorations.end()) break; } } } + if (recalc) + g_pLayoutManager->getCurrentLayout()->recalculateWindow(this); + m_vDecosToRemove.clear(); }