summaryrefslogtreecommitdiff
path: root/src/render
diff options
context:
space:
mode:
authormemchr <118117622+memchr@users.noreply.github.com>2023-09-04 13:13:39 +0000
committerGitHub <noreply@github.com>2023-09-04 15:13:39 +0200
commit69439871e60eeb16993fd6044843d14d2191c9fb (patch)
tree49d8c5d5faa482c9be9404840af3c65e23c8f7a9 /src/render
parent6a0e2bbff36ad53b08289c150925f1037f856475 (diff)
refactor: replace manual iteration of CWindow with existing methods (#3147)
Diffstat (limited to 'src/render')
-rw-r--r--src/render/decorations/CHyprGroupBarDecoration.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp
index 89e047ca..70d4ed93 100644
--- a/src/render/decorations/CHyprGroupBarDecoration.cpp
+++ b/src/render/decorations/CHyprGroupBarDecoration.cpp
@@ -57,15 +57,10 @@ void CHyprGroupBarDecoration::updateWindow(CWindow* pWindow) {
}
m_dwGroupMembers.clear();
- CWindow* curr = pWindow;
- CWindow* head = nullptr;
- while (!curr->m_sGroupData.head) {
- curr = curr->m_sGroupData.pNextWindow;
- }
+ CWindow* head = pWindow->getGroupHead();
+ m_dwGroupMembers.push_back(head);
- head = curr;
- m_dwGroupMembers.push_back(curr);
- curr = curr->m_sGroupData.pNextWindow;
+ CWindow* curr = head->m_sGroupData.pNextWindow;
while (curr != head) {
m_dwGroupMembers.push_back(curr);
curr = curr->m_sGroupData.pNextWindow;