Add a Workspace::forEachAbstractClient
This commit is contained in:
parent
5e96f65224
commit
89be6cf4ed
2 changed files with 7 additions and 0 deletions
|
@ -1685,6 +1685,12 @@ bool Workspace::hasClient(const AbstractClient *c)
|
||||||
return false;
|
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
|
} // namespace
|
||||||
|
|
||||||
#include "workspace.moc"
|
#include "workspace.moc"
|
||||||
|
|
|
@ -116,6 +116,7 @@ public:
|
||||||
*/
|
*/
|
||||||
Client *findClient(Predicate predicate, xcb_window_t w) const;
|
Client *findClient(Predicate predicate, xcb_window_t w) const;
|
||||||
void forEachClient(std::function<void (Client*)> func);
|
void forEachClient(std::function<void (Client*)> func);
|
||||||
|
void forEachAbstractClient(std::function<void (AbstractClient*)> func);
|
||||||
Unmanaged *findUnmanaged(std::function<bool (const Unmanaged*)> func) const;
|
Unmanaged *findUnmanaged(std::function<bool (const Unmanaged*)> func) const;
|
||||||
/**
|
/**
|
||||||
* @brief Finds the Unmanaged with the given window id.
|
* @brief Finds the Unmanaged with the given window id.
|
||||||
|
|
Loading…
Reference in a new issue