diff --git a/effects/shadow.cpp b/effects/shadow.cpp index d69f41cb29..0f900134d1 100644 --- a/effects/shadow.cpp +++ b/effects/shadow.cpp @@ -13,6 +13,7 @@ License. See the file "COPYING" for the exact licensing terms. #include #include +#include #include namespace KWin @@ -46,7 +47,9 @@ void ShadowEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, in if( useShadow( w )) { data.mask |= PAINT_WINDOW_TRANSLUCENT; - data.paint |= QRegion( shadowRectangle( ( QRegion( w->geometry()) & data.paint ).boundingRect() )); + QRect r = ( QRegion( w->geometry()) & data.paint ).boundingRect(); + if( !r.isEmpty()) + data.paint |= shadowRectangle( r ); } effects->prePaintWindow( w, data, time ); }