diff options
| author | Aqa-Ib <victorcana@gmx.com> | 2024-10-30 10:00:58 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-30 10:00:58 +0000 |
| commit | 5f721dce36651232ae245d872c17dfa3aae5cc6c (patch) | |
| tree | 6db9c78da825d1873209f54341552e8b795d024d /src/layout/IHyprLayout.cpp | |
| parent | d679d200299ed4670f0d0f138c793d5f507b7cec (diff) | |
group: fix moveWindowIntoGroup (#8297)
Diffstat (limited to 'src/layout/IHyprLayout.cpp')
| -rw-r--r-- | src/layout/IHyprLayout.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index e3606532..f2616668 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -341,7 +341,9 @@ void IHyprLayout::onEndDragWindow() { const bool FLOATEDINTOTILED = !pWindow->m_bIsFloating && !DRAGGINGWINDOW->m_bDraggingTiled; static auto PDRAGINTOGROUP = CConfigValue<Hyprlang::INT>("group:drag_into_group"); + if (pWindow->m_sGroupData.pNextWindow.lock() && DRAGGINGWINDOW->canBeGroupedInto(pWindow) && *PDRAGINTOGROUP == 1 && !FLOATEDINTOTILED) { + if (DRAGGINGWINDOW->m_bDraggingTiled) { changeWindowFloatingMode(DRAGGINGWINDOW); DRAGGINGWINDOW->m_vLastFloatingSize = m_vDraggingWindowOriginalFloatSize; @@ -349,17 +351,12 @@ void IHyprLayout::onEndDragWindow() { } if (DRAGGINGWINDOW->m_sGroupData.pNextWindow) { - std::vector<PHLWINDOW> members; - PHLWINDOW curr = DRAGGINGWINDOW->getGroupHead(); - do { - members.push_back(curr); - curr = curr->m_sGroupData.pNextWindow.lock(); - } while (curr != members[0]); - - for (auto it = members.begin(); it != members.end(); ++it) { - (*it)->m_bIsFloating = pWindow->m_bIsFloating; // match the floating state of group members - if (pWindow->m_bIsFloating) - (*it)->m_vRealSize = pWindow->m_vRealSize.goal(); // match the size of group members + PHLWINDOW next = DRAGGINGWINDOW->m_sGroupData.pNextWindow.lock(); + while (next != DRAGGINGWINDOW) { + next->m_bIsFloating = pWindow->m_bIsFloating; // match the floating state of group members + next->m_vRealSize = pWindow->m_vRealSize.goal(); // match the size of group members + next->m_vRealPosition = pWindow->m_vRealPosition.goal(); // match the position of group members + next = next->m_sGroupData.pNextWindow.lock(); } } |
