From 0bf2b1de0f5036cd3e929543bd29cf52db9ffc9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 4 Dec 2015 09:53:18 +0100 Subject: [PATCH] Add a Workspace::findAbstractClient Like Workspace::findClient just that it operates on AbstractClient and the m_allClients instead of clients. --- workspace.cpp | 11 +++++++++++ workspace.h | 1 + 2 files changed, 12 insertions(+) diff --git a/workspace.cpp b/workspace.cpp index bc994042d3..07f7fe0415 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -1615,6 +1615,17 @@ Client *Workspace::findClient(std::function func) const return nullptr; } +AbstractClient *Workspace::findAbstractClient(std::function 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 func) const { return Toplevel::findInList(unmanaged, func); diff --git a/workspace.h b/workspace.h index 065306432a..440a7fa6c7 100644 --- a/workspace.h +++ b/workspace.h @@ -105,6 +105,7 @@ public: * @see findClient(Predicate, xcb_window_t) */ Client *findClient(std::function func) const; + AbstractClient *findAbstractClient(std::function func) const; /** * @brief Finds the Client matching the given match @p predicate for the given window. *