diff --git a/shadow.cpp b/shadow.cpp index 958e0858b5..842516713c 100644 --- a/shadow.cpp +++ b/shadow.cpp @@ -170,7 +170,7 @@ bool Shadow::init(KDecoration2::Decoration *decoration) disconnect(m_decorationShadow, &KDecoration2::DecorationShadow::paddingRightChanged, m_topLevel, &Toplevel::getShadow); disconnect(m_decorationShadow, &KDecoration2::DecorationShadow::paddingBottomChanged, m_topLevel, &Toplevel::getShadow); } - m_decorationShadow = static_cast(decoration)->shadow(); + m_decorationShadow = decoration->shadow(); if (!m_decorationShadow) { return false; } diff --git a/shadow.h b/shadow.h index 6799c17dab..4f7169f06b 100644 --- a/shadow.h +++ b/shadow.h @@ -103,7 +103,7 @@ public: void setToplevel(Toplevel *toplevel); bool hasDecorationShadow() const { - return m_decorationShadow; + return !m_decorationShadow.isNull(); } QImage decorationShadowImage() const; @@ -170,7 +170,7 @@ private: QRegion m_shadowRegion; QSize m_cachedSize; // Decoration based shadows - KDecoration2::DecorationShadow *m_decorationShadow; + QPointer m_decorationShadow; }; }