From aebaf0e606ddd7914497f360f02258541d9acd33 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Wed, 19 Apr 2023 20:28:05 -0700 Subject: [PATCH] Fix breakage when disabling layout --- src/Hy3Layout.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp index bd476ea..ced8dbd 100644 --- a/src/Hy3Layout.cpp +++ b/src/Hy3Layout.cpp @@ -888,7 +888,7 @@ void Hy3Layout::alterSplitRatio(CWindow* pWindow, float delta, bool exact) { } std::string Hy3Layout::getLayoutName() { - return "custom"; + return "hy3"; } void Hy3Layout::replaceWindowDataWith(CWindow* from, CWindow* to) { @@ -896,15 +896,19 @@ void Hy3Layout::replaceWindowDataWith(CWindow* from, CWindow* to) { } void Hy3Layout::onEnable() { - for (auto& w : g_pCompositor->m_vWindows) { - if (w->isHidden() || !w->m_bIsMapped || w->m_bFadingOut || w->m_bIsFloating) - continue; + for (auto &window : g_pCompositor->m_vWindows) { + if (window->isHidden() + || !window->m_bIsMapped + || window->m_bFadingOut + || window->m_bIsFloating) + continue; - this->onWindowCreatedTiling(w.get()); - } + this->onWindowCreatedTiling(window.get()); + } } void Hy3Layout::onDisable() { + this->nodes.clear(); } void Hy3Layout::makeGroupOn(CWindow* window, Hy3GroupLayout layout) {