diff --git a/client.cpp b/client.cpp index c7ab92bc03..60fd6e32b8 100644 --- a/client.cpp +++ b/client.cpp @@ -736,6 +736,11 @@ void Client::checkNoBorder() setNoBorder(app_noborder); } +bool Client::wantsShadowToBeRendered() const +{ + return !isFullScreen() && maximizeMode() != KDecorationDefines::MaximizeFull; +} + void Client::updateShape() { if (shape()) { diff --git a/client.h b/client.h index 1fe2a561b0..8433622610 100644 --- a/client.h +++ b/client.h @@ -605,6 +605,7 @@ public: bool decorationHasAlpha() const; bool isClientSideDecorated() const; + bool wantsShadowToBeRendered() const override; Position titlebarPosition() const; diff --git a/scene.cpp b/scene.cpp index 2b6a6414b7..7b97e75127 100644 --- a/scene.cpp +++ b/scene.cpp @@ -826,7 +826,7 @@ WindowQuadList Scene::Window::buildQuads(bool force) const } } - if (m_shadow) { + if (m_shadow && toplevel->wantsShadowToBeRendered()) { ret << m_shadow->shadowQuads(); } effects->buildQuads(toplevel->effectWindow(), ret); diff --git a/toplevel.cpp b/toplevel.cpp index e18e9ea997..356bc5c51f 100644 --- a/toplevel.cpp +++ b/toplevel.cpp @@ -347,6 +347,11 @@ const Shadow *Toplevel::shadow() const } } +bool Toplevel::wantsShadowToBeRendered() const +{ + return true; +} + void Toplevel::getWmOpaqueRegion() { const int length=32768; diff --git a/toplevel.h b/toplevel.h index b11a2b2c9b..99450b9719 100644 --- a/toplevel.h +++ b/toplevel.h @@ -301,6 +301,11 @@ public: * Call this method when the Property changes or Compositing is started. **/ void getShadow(); + /** + * Whether the Toplevel currently wants the shadow to be rendered. Default + * implementation always returns @c true. + **/ + virtual bool wantsShadowToBeRendered() const; /** * This method returns the area that the Toplevel window reports to be opaque.