Add a Workspace::findAbstractClient

Like Workspace::findClient just that it operates on AbstractClient
and the m_allClients instead of clients.
This commit is contained in:
Martin Gräßlin 2015-12-04 09:53:18 +01:00
parent cb400d7128
commit 0bf2b1de0f
2 changed files with 12 additions and 0 deletions

View file

@ -1615,6 +1615,17 @@ Client *Workspace::findClient(std::function<bool (const Client*)> func) const
return nullptr;
}
AbstractClient *Workspace::findAbstractClient(std::function<bool (const AbstractClient*)> func) const
{
if (AbstractClient *ret = Toplevel::findInList(m_allClients, func)) {
return ret;
}
if (Client *ret = Toplevel::findInList(desktops, func)) {
return ret;
}
return nullptr;
}
Unmanaged *Workspace::findUnmanaged(std::function<bool (const Unmanaged*)> func) const
{
return Toplevel::findInList(unmanaged, func);

View file

@ -105,6 +105,7 @@ public:
* @see findClient(Predicate, xcb_window_t)
*/
Client *findClient(std::function<bool (const Client*)> func) const;
AbstractClient *findAbstractClient(std::function<bool (const AbstractClient*)> func) const;
/**
* @brief Finds the Client matching the given match @p predicate for the given window.
*