Allow Client to disable the rendering of DecorationShadow

For maximized and fullscreen windows we don't want the shadow to be
renderer at all.
This commit is contained in:
Martin Gräßlin 2014-07-24 08:55:57 +02:00
parent 08d146de91
commit 98a5c4e050
5 changed files with 17 additions and 1 deletions

View file

@ -736,6 +736,11 @@ void Client::checkNoBorder()
setNoBorder(app_noborder);
}
bool Client::wantsShadowToBeRendered() const
{
return !isFullScreen() && maximizeMode() != KDecorationDefines::MaximizeFull;
}
void Client::updateShape()
{
if (shape()) {

View file

@ -605,6 +605,7 @@ public:
bool decorationHasAlpha() const;
bool isClientSideDecorated() const;
bool wantsShadowToBeRendered() const override;
Position titlebarPosition() const;

View file

@ -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);

View file

@ -347,6 +347,11 @@ const Shadow *Toplevel::shadow() const
}
}
bool Toplevel::wantsShadowToBeRendered() const
{
return true;
}
void Toplevel::getWmOpaqueRegion()
{
const int length=32768;

View file

@ -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.