summaryrefslogtreecommitdiff
path: root/src/Window.cpp
diff options
context:
space:
mode:
authorMightyPlaza <123664421+MightyPlaza@users.noreply.github.com>2023-10-30 14:54:12 +0000
committerGitHub <noreply@github.com>2023-10-30 14:54:12 +0000
commita1924ae4356657a06e43e740f1cf2e1634fa958d (patch)
tree3d73c334ec5bb22b956f8c0293ac61234fe11a9d /src/Window.cpp
parentcb6cfde6e82f9b146ba1bd937472aa17ec829167 (diff)
internal: create canBeGroupedInto() (#3693)
modified: src/Window.cpp modified: src/Window.hpp modified: src/layout/DwindleLayout.cpp modified: src/layout/MasterLayout.cpp modified: src/render/decorations/CHyprGroupBarDecoration.cpp
Diffstat (limited to 'src/Window.cpp')
-rw-r--r--src/Window.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Window.cpp b/src/Window.cpp
index fb46740b..77960dc6 100644
--- a/src/Window.cpp
+++ b/src/Window.cpp
@@ -767,6 +767,15 @@ int CWindow::getGroupSize() {
return size;
}
+bool CWindow::canBeGroupedInto(CWindow* pWindow) {
+ return !g_pKeybindManager->m_bGroupsLocked // global group lock disengaged
+ && ((m_eGroupRules & GROUP_INVADE && m_bFirstMap) // window ignore local group locks, or
+ || (!pWindow->getGroupHead()->m_sGroupData.locked // target unlocked
+ && !(m_sGroupData.pNextWindow && getGroupHead()->m_sGroupData.locked))) // source unlocked or isn't group
+ && !m_sGroupData.deny // source is not denied entry
+ && !(m_eGroupRules & GROUP_BARRED && m_bFirstMap); // group rule doesn't prevent adding window
+}
+
CWindow* CWindow::getGroupWindowByIndex(int index) {
const int SIZE = getGroupSize();
index = ((index % SIZE) + SIZE) % SIZE;