summaryrefslogtreecommitdiff
path: root/src/layout/MasterLayout.cpp
diff options
context:
space:
mode:
authormemchr <118117622+memchr@users.noreply.github.com>2023-09-21 23:42:00 +0000
committerGitHub <noreply@github.com>2023-09-22 00:42:00 +0100
commit1357b66091ecd73f097d19d527a23a9ae72a4ff1 (patch)
treee629bedcce584757ebd1afae0dcc12ea25f15c95 /src/layout/MasterLayout.cpp
parent2e1842b5ff140bc81a604c663482221d86c30cff (diff)
windowrules: add rule `group` to map windows grouped (#3279)
* windows: add rule group to map windows grouped * group rule: use `invade` to force open a window in a locked group
Diffstat (limited to 'src/layout/MasterLayout.cpp')
-rw-r--r--src/layout/MasterLayout.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp
index 5b5d0122..c1dd37dc 100644
--- a/src/layout/MasterLayout.cpp
+++ b/src/layout/MasterLayout.cpp
@@ -95,11 +95,15 @@ void CHyprMasterLayout::onWindowCreatedTiling(CWindow* pWindow, eDirection direc
const auto MOUSECOORDS = g_pInputManager->getMouseCoordsInternal();
// if it's a group, add the window
- if (OPENINGON && OPENINGON != PNODE && OPENINGON->pWindow->m_sGroupData.pNextWindow && // target is group
- !OPENINGON->pWindow->getGroupHead()->m_sGroupData.locked && // target unlocked
- !(pWindow->m_sGroupData.pNextWindow && pWindow->getGroupHead()->m_sGroupData.locked) && // source unlocked or isn't group
- !g_pKeybindManager->m_bGroupsLocked // global group lock disengaged
+ if (OPENINGON && OPENINGON != PNODE && OPENINGON->pWindow->m_sGroupData.pNextWindow // target is group
+ && !g_pKeybindManager->m_bGroupsLocked // global group lock disengaged
+ && ((pWindow->m_eGroupRules & GROUP_INVADE && pWindow->m_bFirstMap) // window ignore local group locks, or
+ || (!OPENINGON->pWindow->getGroupHead()->m_sGroupData.locked // target unlocked
+ && !(pWindow->m_sGroupData.pNextWindow && pWindow->getGroupHead()->m_sGroupData.locked))) // source unlocked or isn't group
+ && !pWindow->m_sGroupData.deny // source is not denied entry
+ && !(pWindow->m_eGroupRules & GROUP_BARRED) // group rule doesn't prevent adding window
) {
+
if (!pWindow->m_sGroupData.pNextWindow)
pWindow->m_dWindowDecorations.emplace_back(std::make_unique<CHyprGroupBarDecoration>(pWindow));
@@ -119,12 +123,15 @@ void CHyprMasterLayout::onWindowCreatedTiling(CWindow* pWindow, eDirection direc
}
OPENINGON->pWindow->setGroupCurrent(pWindow);
+ pWindow->applyGroupRules();
pWindow->updateWindowDecos();
recalculateWindow(pWindow);
return;
}
+ pWindow->applyGroupRules();
+
if (*PNEWISMASTER || WINDOWSONWORKSPACE == 1 || (!pWindow->m_bFirstMap && OPENINGON->isMaster)) {
for (auto& nd : m_lMasterNodesData) {
if (nd.isMaster && nd.workspaceID == PNODE->workspaceID) {