diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2023-02-19 21:07:32 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-19 21:07:32 +0000 |
| commit | e5a4c0c986f72813e8822f31ed3d5fa6be1b6c13 (patch) | |
| tree | 8ce0ad44055c63e905303f49da61c9f44316170a /src/layout/MasterLayout.cpp | |
| parent | 2363cc2572c8b1f99a3ac5ff4104067b0503a302 (diff) | |
Group/Tab Rework (#1580)
Diffstat (limited to 'src/layout/MasterLayout.cpp')
| -rw-r--r-- | src/layout/MasterLayout.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
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<CHyprGroupBarDecoration>(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()) |
