mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 05:45:59 +01:00
properly meld groups together
This commit is contained in:
parent
df2956b411
commit
40622a9e60
1 changed files with 18 additions and 0 deletions
|
@ -531,6 +531,24 @@ void CWindow::insertWindowToGroup(CWindow* pWindow) {
|
|||
const auto PHEAD = getGroupHead();
|
||||
const auto PTAIL = getGroupTail();
|
||||
|
||||
if (pWindow->m_sGroupData.pNextWindow) {
|
||||
std::vector<CWindow*> members;
|
||||
CWindow* curr = pWindow;
|
||||
do {
|
||||
const auto PLAST = curr;
|
||||
members.push_back(curr);
|
||||
curr = curr->m_sGroupData.pNextWindow;
|
||||
PLAST->m_sGroupData.pNextWindow = nullptr;
|
||||
PLAST->m_sGroupData.head = false;
|
||||
} while (curr != pWindow);
|
||||
|
||||
for (auto& w : members) {
|
||||
insertWindowToGroup(w);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
PTAIL->m_sGroupData.pNextWindow = pWindow;
|
||||
pWindow->m_sGroupData.pNextWindow = PHEAD;
|
||||
|
||||
|
|
Loading…
Reference in a new issue