From a9ce4aa2af62d680ab0ad9656277fa95d7ece298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 3 Apr 2011 13:05:35 +0200 Subject: [PATCH] Don't render a Shadow if the Shadow overlaps the window --- shadow.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/shadow.cpp b/shadow.cpp index 9e9179a608..5127a42ed3 100644 --- a/shadow.cpp +++ b/shadow.cpp @@ -127,6 +127,14 @@ void Shadow::buildQuads() const QRect bottomLeftRect(QPoint(0, 0), m_shadowElements[ShadowElementBottomLeft].size()); const QRect leftRect(QPoint(0, 0), m_shadowElements[ShadowElementLeft].size()); const QRect topLeftRect(QPoint(0, 0), m_shadowElements[ShadowElementTopLeft].size()); + if ((leftRect.width() - m_leftOffset > m_topLevel->width()) || + (rightRect.width() - m_rightOffset > m_topLevel->width()) || + (topRect.height() - m_topOffset > m_topLevel->height()) || + (bottomRect.height() - m_bottomOffset > m_topLevel->height())) { + // if our shadow is bigger than the window, we don't render the shadow + m_shadowRegion = QRegion(); + return; + } WindowQuad topLeftQuad(WindowQuadShadowTopLeft); topLeftQuad[ 0 ] = WindowVertex(-m_leftOffset, -m_topOffset, 0.0, 0.0); topLeftQuad[ 1 ] = WindowVertex(-m_leftOffset + topLeftRect.width(), -m_topOffset, 1.0, 0.0);