Add a Workspace::forEachAbstractClient

This commit is contained in:
Martin Gräßlin 2015-12-17 15:49:32 +01:00
parent 5e96f65224
commit 89be6cf4ed
2 changed files with 7 additions and 0 deletions

View file

@ -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"

View file

@ -116,6 +116,7 @@ public:
*/
Client *findClient(Predicate predicate, xcb_window_t w) const;
void forEachClient(std::function<void (Client*)> func);
void forEachAbstractClient(std::function<void (AbstractClient*)> func);
Unmanaged *findUnmanaged(std::function<bool (const Unmanaged*)> func) const;
/**
* @brief Finds the Unmanaged with the given window id.