diff --git a/shadow.cpp b/shadow.cpp --- a/shadow.cpp +++ b/shadow.cpp @@ -331,51 +331,37 @@ bool Shadow::updateShadow() { - auto clear = [this] { - if (m_topLevel && m_topLevel->shadow()) { - auto w = m_topLevel->effectWindow(); - // this also deletes the shadow - w->sceneWindow()->updateShadow(nullptr); - emit m_topLevel->shadowChanged(); - } - }; - if (!m_topLevel) { return false; } if (m_decorationShadow) { if (AbstractClient *c = qobject_cast(m_topLevel)) { if (c->decoration()) { if (init(c->decoration())) { - emit m_topLevel->shadowChanged(); return true; } } } - clear(); return false; } if (waylandServer()) { if (m_topLevel && m_topLevel->surface()) { if (const auto &s = m_topLevel->surface()->shadow()) { if (init(s)) { - emit m_topLevel->shadowChanged(); return true; } } } } auto data = Shadow::readX11ShadowProperty(m_topLevel->window()); if (data.isEmpty()) { - clear(); return false; } init(data); - emit m_topLevel->shadowChanged(); return true; } diff --git a/toplevel.cpp b/toplevel.cpp --- a/toplevel.cpp +++ b/toplevel.cpp @@ -336,7 +336,10 @@ const QRect oldVisibleRect = visibleRect(); if (hasShadow()) { dirtyRect = shadow()->shadowRegion().boundingRect(); - effectWindow()->sceneWindow()->shadow()->updateShadow(); + if (!effectWindow()->sceneWindow()->shadow()->updateShadow()) { + effectWindow()->sceneWindow()->updateShadow(nullptr); + } + emit shadowChanged(); } else { Shadow::createShadow(this); }