workspace: Add count group flag in windowCount workspace selector prop (#5499)

* Add groupCount workspace selector prop

* Intergrate groupCount with windowCount
This commit is contained in:
Sungyoon Cho
2024-04-09 20:08:38 +09:00
committed by GitHub
parent f6786f04d2
commit fcac25bcc2
4 changed files with 47 additions and 11 deletions

View File

@@ -1280,6 +1280,16 @@ int CCompositor::getWindowsOnWorkspace(const int& id, std::optional<bool> onlyTi
return no;
}
int CCompositor::getGroupsOnWorkspace(const int& id, std::optional<bool> onlyTiled) {
int no = 0;
for (auto& w : m_vWindows) {
if (w->workspaceID() == id && w->m_bIsMapped && !(onlyTiled.has_value() && !w->m_bIsFloating != onlyTiled.value()) && w->m_sGroupData.head)
no++;
}
return no;
}
CWindow* CCompositor::getUrgentWindow() {
for (auto& w : m_vWindows) {
if (w->m_bIsMapped && w->m_bIsUrgent)