Commit 1ef90d9c authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Add API to easily find Toplevels from their internal Id

parent fbbf9675
......@@ -1712,6 +1712,13 @@ Toplevel *Workspace::findToplevel(std::function<bool (const Toplevel*)> func) co
return nullptr;
}
Toplevel *Workspace::findToplevel(const QUuid &internalId) const
{
return findToplevel([internalId] (const KWin::Toplevel* l) -> bool {
return internalId == l->internalId();
});
}
void Workspace::forEachToplevel(std::function<void (Toplevel *)> func)
{
std::for_each(m_allClients.constBegin(), m_allClients.constEnd(), func);
......
......@@ -134,6 +134,9 @@ public:
void forEachUnmanaged(std::function<void (Unmanaged*)> func);
Toplevel *findToplevel(std::function<bool (const Toplevel*)> func) const;
void forEachToplevel(std::function<void (Toplevel *)> func);
Toplevel *findToplevel(const QUuid &internalId) const;
/**
* @brief Finds a Toplevel for the internal window @p w.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment