fix groups not updating size on head change

This commit is contained in:
vaxerski 2022-08-13 10:08:35 +02:00
parent 9136783e9c
commit 214c2c7b1c
2 changed files with 23 additions and 0 deletions

View File

@ -63,6 +63,20 @@ SDwindleNodeData* SDwindleNodeData::getGroupHead() {
return this;
}
SDwindleNodeData* SDwindleNodeData::getGroupVisible() {
SDwindleNodeData* current = this->pNextGroupMember;
while (current != this) {
if (!current->pWindow->m_bHidden) {
return current;
}
current = current->pNextGroupMember;
}
return this;
}
void SDwindleNodeData::setGroupFocusedNode(SDwindleNodeData* pMember) {
SDwindleNodeData* current = this->pNextGroupMember;
@ -222,6 +236,14 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SDwindleNodeData* pNode, bool for
PWINDOW->m_vRealSize.warp();
}
if (pNode->isGroupMember() && pNode->groupHead) {
// update visible node
const auto PVISNODE = pNode->getGroupVisible();
PVISNODE->pWindow->m_vRealSize = PWINDOW->m_vRealSize.goalv();
PVISNODE->pWindow->m_vRealPosition = PWINDOW->m_vRealPosition.goalv();
}
PWINDOW->updateWindowDecos();
}

View File

@ -40,6 +40,7 @@ struct SDwindleNodeData {
void getAllChildrenRecursive(std::deque<SDwindleNodeData*>*);
bool isGroupMember();
SDwindleNodeData* getGroupHead();
SDwindleNodeData* getGroupVisible();
void setGroupFocusedNode(SDwindleNodeData*);
CHyprDwindleLayout* layout = nullptr;
};