From 89be6cf4ed8e5d9598b2df63b8f0fabbba45fec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 17 Dec 2015 15:49:32 +0100 Subject: [PATCH] Add a Workspace::forEachAbstractClient --- workspace.cpp | 6 ++++++ workspace.h | 1 + 2 files changed, 7 insertions(+) diff --git a/workspace.cpp b/workspace.cpp index 206caab988..8d9335357b 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -1685,6 +1685,12 @@ bool Workspace::hasClient(const AbstractClient *c) return false; } +void Workspace::forEachAbstractClient(std::function< void (AbstractClient*) > func) +{ + std::for_each(m_allClients.constBegin(), m_allClients.constEnd(), func); + std::for_each(desktops.constBegin(), desktops.constEnd(), func); +} + } // namespace #include "workspace.moc" diff --git a/workspace.h b/workspace.h index 440a7fa6c7..432dbf4a9c 100644 --- a/workspace.h +++ b/workspace.h @@ -116,6 +116,7 @@ public: */ Client *findClient(Predicate predicate, xcb_window_t w) const; void forEachClient(std::function func); + void forEachAbstractClient(std::function func); Unmanaged *findUnmanaged(std::function func) const; /** * @brief Finds the Unmanaged with the given window id.