From a1924ae4356657a06e43e740f1cf2e1634fa958d Mon Sep 17 00:00:00 2001 From: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com> Date: Mon, 30 Oct 2023 14:54:12 +0000 Subject: 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 --- src/Window.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/Window.cpp') 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; -- cgit v1.2.3