From e5fe1ebd2089ec9a89f76615f571205f0c1b40e9 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 18 Apr 2022 10:58:53 +0300 Subject: [PATCH] Remove AbstractClient plumbing casts in Shadow --- src/shadow.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/shadow.cpp b/src/shadow.cpp index cee954531c..3b4415e038 100644 --- a/src/shadow.cpp +++ b/src/shadow.cpp @@ -74,17 +74,13 @@ Shadow *Shadow::createShadowFromX11(AbstractClient *toplevel) } } -Shadow *Shadow::createShadowFromDecoration(AbstractClient *toplevel) +Shadow *Shadow::createShadowFromDecoration(AbstractClient *window) { - auto c = static_cast(toplevel->isClient() ? toplevel : nullptr); - if (!c) { + if (!window->decoration()) { return nullptr; } - if (!c->decoration()) { - return nullptr; - } - Shadow *shadow = Compositor::self()->scene()->createShadow(toplevel); - if (!shadow->init(c->decoration())) { + Shadow *shadow = Compositor::self()->scene()->createShadow(window); + if (!shadow->init(window->decoration())) { delete shadow; return nullptr; } @@ -289,9 +285,9 @@ bool Shadow::updateShadow() } if (m_decorationShadow) { - if (auto c = static_cast(m_topLevel->isClient() ? m_topLevel : nullptr)) { - if (c->decoration()) { - if (init(c->decoration())) { + if (m_topLevel) { + if (m_topLevel->decoration()) { + if (init(m_topLevel->decoration())) { return true; } }