Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit 3dff1a8a authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

[effects] Drop static_cast in getMainWindows

We use a function template, so static_cast in getMainWindows looks out
of place. Also, it's not good idea to do static_cast based on output of

Test Plan: The Dialog Parent effect works.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision:
parent c3e712e9
......@@ -1897,9 +1897,8 @@ EffectWindow* EffectWindowImpl::findModal()
template <typename T>
EffectWindowList getMainWindows(Toplevel *toplevel)
EffectWindowList getMainWindows(T *c)
T *c = static_cast<T*>(toplevel);
const auto mainclients = c->mainClients();
EffectWindowList ret;
......@@ -1911,12 +1910,13 @@ EffectWindowList getMainWindows(Toplevel *toplevel)
EffectWindowList EffectWindowImpl::mainWindows() const
if (dynamic_cast<AbstractClient*>(toplevel)) {
return getMainWindows<AbstractClient>(toplevel);
} else if (toplevel->isDeleted()) {
return getMainWindows<Deleted>(toplevel);
if (auto client = qobject_cast<AbstractClient *>(toplevel)) {
return getMainWindows(client);
return EffectWindowList();
if (auto deleted = qobject_cast<Deleted *>(toplevel)) {
return getMainWindows(deleted);
return {};
WindowQuadList EffectWindowImpl::buildQuads(bool force) const
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