mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 21:05:57 +01:00
refactor: flatten nesting if
s in layout window creation method (#3294)
This commit is contained in:
parent
0e64dd2ea5
commit
e6651334f2
2 changed files with 59 additions and 60 deletions
|
@ -318,10 +318,10 @@ void CHyprDwindleLayout::onWindowCreatedTiling(CWindow* pWindow, eDirection dire
|
||||||
}
|
}
|
||||||
|
|
||||||
// if it's a group, add the window
|
// if it's a group, add the window
|
||||||
if (OPENINGON->pWindow->m_sGroupData.pNextWindow && !OPENINGON->pWindow->getGroupHead()->m_sGroupData.locked && !g_pKeybindManager->m_bGroupsLocked &&
|
if (OPENINGON->pWindow->m_sGroupData.pNextWindow && // target is group
|
||||||
!m_vOverrideFocalPoint) { // target is an unlocked group
|
!OPENINGON->pWindow->getGroupHead()->m_sGroupData.locked && // target unlocked
|
||||||
|
!(pWindow->m_sGroupData.pNextWindow && pWindow->getGroupHead()->m_sGroupData.locked) && // source unlocked or isn't group
|
||||||
if (!pWindow->m_sGroupData.pNextWindow || !pWindow->getGroupHead()->m_sGroupData.locked) { // source is not a group or an unlocked group
|
!g_pKeybindManager->m_bGroupsLocked && !m_vOverrideFocalPoint) {
|
||||||
if (!pWindow->m_sGroupData.pNextWindow)
|
if (!pWindow->m_sGroupData.pNextWindow)
|
||||||
pWindow->m_dWindowDecorations.emplace_back(std::make_unique<CHyprGroupBarDecoration>(pWindow));
|
pWindow->m_dWindowDecorations.emplace_back(std::make_unique<CHyprGroupBarDecoration>(pWindow));
|
||||||
|
|
||||||
|
@ -346,7 +346,6 @@ void CHyprDwindleLayout::onWindowCreatedTiling(CWindow* pWindow, eDirection dire
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// If it's not, get the node under our cursor
|
// If it's not, get the node under our cursor
|
||||||
|
|
||||||
|
|
|
@ -94,10 +94,11 @@ void CHyprMasterLayout::onWindowCreatedTiling(CWindow* pWindow, eDirection direc
|
||||||
const auto MOUSECOORDS = g_pInputManager->getMouseCoordsInternal();
|
const auto MOUSECOORDS = g_pInputManager->getMouseCoordsInternal();
|
||||||
|
|
||||||
// if it's a group, add the window
|
// if it's a group, add the window
|
||||||
if (OPENINGON && OPENINGON->pWindow->m_sGroupData.pNextWindow && !OPENINGON->pWindow->getGroupHead()->m_sGroupData.locked && !g_pKeybindManager->m_bGroupsLocked &&
|
if (OPENINGON && OPENINGON != PNODE && OPENINGON->pWindow->m_sGroupData.pNextWindow && // target is group
|
||||||
OPENINGON != PNODE) { // target is an unlocked group
|
!OPENINGON->pWindow->getGroupHead()->m_sGroupData.locked && // target unlocked
|
||||||
|
!(pWindow->m_sGroupData.pNextWindow && pWindow->getGroupHead()->m_sGroupData.locked) && // source unlocked or isn't group
|
||||||
if (!pWindow->m_sGroupData.pNextWindow || !pWindow->getGroupHead()->m_sGroupData.locked) { // source is not a group or an unlocked group
|
!g_pKeybindManager->m_bGroupsLocked // global group lock disengaged
|
||||||
|
) {
|
||||||
if (!pWindow->m_sGroupData.pNextWindow)
|
if (!pWindow->m_sGroupData.pNextWindow)
|
||||||
pWindow->m_dWindowDecorations.emplace_back(std::make_unique<CHyprGroupBarDecoration>(pWindow));
|
pWindow->m_dWindowDecorations.emplace_back(std::make_unique<CHyprGroupBarDecoration>(pWindow));
|
||||||
|
|
||||||
|
@ -122,7 +123,6 @@ void CHyprMasterLayout::onWindowCreatedTiling(CWindow* pWindow, eDirection direc
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (*PNEWISMASTER || WINDOWSONWORKSPACE == 1 || (!pWindow->m_bFirstMap && OPENINGON->isMaster)) {
|
if (*PNEWISMASTER || WINDOWSONWORKSPACE == 1 || (!pWindow->m_bFirstMap && OPENINGON->isMaster)) {
|
||||||
for (auto& nd : m_lMasterNodesData) {
|
for (auto& nd : m_lMasterNodesData) {
|
||||||
|
|
Loading…
Reference in a new issue