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.