summaryrefslogtreecommitdiff
path: root/src/debug/HyprCtl.cpp
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2023-02-20 09:28:42 +0000
committervaxerski <vaxry@vaxry.net>2023-02-20 09:28:42 +0000
commitecd015626546e28e759afde606e63d71d2fae181 (patch)
tree35b6e1dc7565f13d75433c16fb67f66713d2371c /src/debug/HyprCtl.cpp
parentcd6640e89059e049e69784b91b937afcd5d5e05d (diff)
fix group data in hyprctl
Diffstat (limited to 'src/debug/HyprCtl.cpp')
-rw-r--r--src/debug/HyprCtl.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index b55bf43d..91af3938 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -65,8 +65,8 @@ std::string monitorsRequest(HyprCtl::eHyprCtlOutputFormat format) {
(m->output->description ? m->output->description : ""), (m->output->make ? m->output->make : ""), (m->output->model ? m->output->model : ""),
(m->output->serial ? m->output->serial : ""), m->activeWorkspace, g_pCompositor->getWorkspaceByID(m->activeWorkspace)->m_szName.c_str(),
(int)m->vecReservedTopLeft.x, (int)m->vecReservedTopLeft.y, (int)m->vecReservedBottomRight.x, (int)m->vecReservedBottomRight.y, m->scale,
- (int)m->transform, (m.get() == g_pCompositor->m_pLastMonitor ? "yes" : "no"),
- (int)m->dpmsStatus, (int)(m->output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED));
+ (int)m->transform, (m.get() == g_pCompositor->m_pLastMonitor ? "yes" : "no"), (int)m->dpmsStatus,
+ (int)(m->output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED));
}
}
@@ -75,14 +75,16 @@ std::string monitorsRequest(HyprCtl::eHyprCtlOutputFormat format) {
static std::string getGroupedData(CWindow* w, HyprCtl::eHyprCtlOutputFormat format) {
const bool isJson = format == HyprCtl::FORMAT_JSON;
- if (g_pLayoutManager->getCurrentLayout()->getLayoutName() != "dwindle")
+ if (!w->m_sGroupData.pNextWindow)
return isJson ? "" : "0";
- SLayoutMessageHeader header;
- header.pWindow = w;
- const auto groupMembers = std::any_cast<std::deque<CWindow*>>(g_pLayoutManager->getCurrentLayout()->layoutMessage(header, "groupinfo"));
- if (groupMembers.empty())
- return isJson ? "" : "0";
+ std::vector<CWindow*> groupMembers;
+
+ CWindow* curr = w;
+ do {
+ groupMembers.push_back(curr);
+ curr = curr->m_sGroupData.pNextWindow;
+ } while (curr != w);
const auto comma = isJson ? ", " : ",";
const auto fmt = isJson ? "\"0x%x\"" : "%x";