From e5a4c0c986f72813e8822f31ed3d5fa6be1b6c13 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sun, 19 Feb 2023 21:07:32 +0000 Subject: Group/Tab Rework (#1580) --- src/layout/MasterLayout.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/layout/MasterLayout.cpp') diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index e349d650..5c310ed9 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -83,6 +83,20 @@ void CHyprMasterLayout::onWindowCreatedTiling(CWindow* pWindow) { const auto WINDOWSONWORKSPACE = getNodesOnWorkspace(PNODE->workspaceID); float lastSplitPercent = 0.5f; + auto OPENINGON = isWindowTiled(g_pCompositor->m_pLastWindow) && g_pCompositor->m_pLastWindow->m_iWorkspaceID == pWindow->m_iWorkspaceID ? + getNodeFromWindow(g_pCompositor->m_pLastWindow) : + getMasterNodeOnWorkspace(pWindow->m_iWorkspaceID); + + if (OPENINGON && OPENINGON->pWindow->m_sGroupData.pNextWindow && OPENINGON != PNODE) { + m_lMasterNodesData.remove(*PNODE); + + OPENINGON->pWindow->insertWindowToGroup(pWindow); + + pWindow->m_dWindowDecorations.emplace_back(std::make_unique(pWindow)); + + return; + } + if (*PNEWISMASTER || WINDOWSONWORKSPACE == 1) { for (auto& nd : m_lMasterNodesData) { if (nd.isMaster && nd.workspaceID == PNODE->workspaceID) { @@ -1011,6 +1025,17 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri return 0; } +void CHyprMasterLayout::replaceWindowDataWith(CWindow* from, CWindow* to) { + const auto PNODE = getNodeFromWindow(from); + + if (!PNODE) + return; + + PNODE->pWindow = to; + + applyNodeDataToWindow(PNODE); +} + void CHyprMasterLayout::onEnable() { for (auto& w : g_pCompositor->m_vWindows) { if (w->m_bIsFloating || !w->m_bMappedX11 || !w->m_bIsMapped || w->isHidden()) -- cgit v1.2.3