diff --git a/src/workspace.cpp b/src/workspace.cpp index 1cf81241ee..67ee32912a 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -1859,14 +1859,9 @@ void Workspace::forEachToplevel(std::function func) bool Workspace::hasClient(const AbstractClient *c) { - if (auto cc = dynamic_cast(c)) { - return hasClient(cc); - } else { - return findAbstractClient([c](const AbstractClient *test) { - return test == c; - }) != nullptr; - } - return false; + return findAbstractClient([&c](const AbstractClient *test) { + return test == c; + }) != nullptr; } void Workspace::forEachAbstractClient(std::function< void (AbstractClient*) > func) diff --git a/src/workspace.h b/src/workspace.h index 352638b52d..decd8f50e0 100644 --- a/src/workspace.h +++ b/src/workspace.h @@ -71,7 +71,6 @@ public: bool workspaceEvent(xcb_generic_event_t*); bool workspaceEvent(QEvent*); - bool hasClient(const X11Client *); bool hasClient(const AbstractClient*); /** @@ -791,13 +790,6 @@ void Workspace::forEachUnmanaged(std::function< void (Unmanaged*) > func) std::for_each(m_unmanaged.constBegin(), m_unmanaged.constEnd(), func); } -inline bool Workspace::hasClient(const X11Client *c) -{ - return findClient([c](const X11Client *test) { - return test == c; - }); -} - inline Workspace *workspace() { return Workspace::_self;