mirror of
https://github.com/ItsDrike/hyprland-dwindle-autogroup.git
synced 2024-11-09 18:59:40 +00:00
Remove unnecessary parents deque from addChildNodesToDequeRecursive
This commit is contained in:
parent
16f67af969
commit
93d3948bfb
11
src/main.cpp
11
src/main.cpp
|
@ -14,12 +14,11 @@ inline std::function<void(std::string)> originalToggleGroup = nullptr;
|
||||||
typedef SDwindleNodeData* (*nodeFromWindowT)(void*, CWindow*);
|
typedef SDwindleNodeData* (*nodeFromWindowT)(void*, CWindow*);
|
||||||
inline nodeFromWindowT g_pNodeFromWindow = nullptr;
|
inline nodeFromWindowT g_pNodeFromWindow = nullptr;
|
||||||
|
|
||||||
void addChildNodesToDequeRecursive(std::deque<SDwindleNodeData*>* pDeque, std::deque<SDwindleNodeData*>* pParents, SDwindleNodeData* node)
|
void addChildNodesToDequeRecursive(std::deque<SDwindleNodeData*>* pDeque, SDwindleNodeData* node)
|
||||||
{
|
{
|
||||||
if (node->isNode) {
|
if (node->isNode) {
|
||||||
pParents->push_back(node);
|
addChildNodesToDequeRecursive(pDeque, node->children[0]);
|
||||||
addChildNodesToDequeRecursive(pDeque, pParents, node->children[0]);
|
addChildNodesToDequeRecursive(pDeque, node->children[1]);
|
||||||
addChildNodesToDequeRecursive(pDeque, pParents, node->children[1]);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pDeque->emplace_back(node);
|
pDeque->emplace_back(node);
|
||||||
|
@ -64,10 +63,8 @@ void groupCreate(const SDwindleNodeData* PNODE, CHyprDwindleLayout* layout)
|
||||||
originalToggleGroup("");
|
originalToggleGroup("");
|
||||||
|
|
||||||
std::deque<SDwindleNodeData*> newGroupMembers;
|
std::deque<SDwindleNodeData*> newGroupMembers;
|
||||||
std::deque<SDwindleNodeData*> parentNodes;
|
|
||||||
|
|
||||||
addChildNodesToDequeRecursive(
|
addChildNodesToDequeRecursive(&newGroupMembers, PNODE->pParent->children[0] == PNODE ? PNODE->pParent->children[1] : PNODE->pParent->children[0]);
|
||||||
&newGroupMembers, &parentNodes, PNODE->pParent->children[0] == PNODE ? PNODE->pParent->children[1] : PNODE->pParent->children[0]);
|
|
||||||
|
|
||||||
// Make sure one of the child nodes isn't itself a group
|
// Make sure one of the child nodes isn't itself a group
|
||||||
for (auto& n : newGroupMembers) {
|
for (auto& n : newGroupMembers) {
|
||||||
|
|
Loading…
Reference in a new issue