From 185f93ae64d2fe616d06ba1b9919cf1e98168bd6 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 20 Aug 2022 17:59:15 +0200 Subject: [PATCH] fix dwindle active for splits --- src/layout/DwindleLayout.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index 3e1b697b..da48ac31 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -277,7 +277,7 @@ void CHyprDwindleLayout::onWindowCreatedTiling(CWindow* pWindow) { OPENINGON = getFirstNodeOnWorkspace(PMONITOR->activeWorkspace); } else if (*PUSEACTIVE) { - if (g_pCompositor->windowValidMapped(g_pCompositor->m_pLastWindow) && !g_pCompositor->m_pLastWindow->m_bIsFloating) { + if (g_pCompositor->windowValidMapped(g_pCompositor->m_pLastWindow) && !g_pCompositor->m_pLastWindow->m_bIsFloating && g_pCompositor->m_pLastWindow != pWindow && g_pCompositor->m_pLastWindow->m_iWorkspaceID == pWindow->m_iWorkspaceID && g_pCompositor->m_pLastWindow->m_bIsMapped) { OPENINGON = getNodeFromWindow(g_pCompositor->m_pLastWindow); } else { OPENINGON = getNodeFromWindow(g_pCompositor->vectorToWindowTiled(g_pInputManager->getMouseCoordsInternal())); @@ -419,8 +419,10 @@ void CHyprDwindleLayout::onWindowRemovedTiling(CWindow* pWindow) { const auto PNODE = getNodeFromWindow(pWindow); - if (!PNODE) + if (!PNODE) { + Debug::log(ERR, "onWindowRemovedTiling node null?"); return; + } // check if it was grouped if (PNODE->isGroupMember()) { @@ -466,6 +468,7 @@ void CHyprDwindleLayout::onWindowRemovedTiling(CWindow* pWindow) { const auto PPARENT = PNODE->pParent; if (!PPARENT) { + Debug::log(LOG, "Removing last node (dwindle)"); m_lDwindleNodesData.remove(*PNODE); return; } @@ -1066,4 +1069,4 @@ void CHyprDwindleLayout::onEnable() { void CHyprDwindleLayout::onDisable() { m_lDwindleNodesData.clear(); -} \ No newline at end of file +}