From 2bb64077e7e41ce65c9d5847ce6f397cc79c57e0 Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Tue, 25 Nov 2008 02:58:28 +0000 Subject: [PATCH] Don't allow windows to cast shadows on screens they are not on. BUG: 176018 svn path=/trunk/KDE/kdebase/workspace/; revision=888665 --- effects/shadow.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/effects/shadow.cpp b/effects/shadow.cpp index 8eb56d28b7..eb6f526d7c 100644 --- a/effects/shadow.cpp +++ b/effects/shadow.cpp @@ -653,6 +653,16 @@ void ShadowEffect::drawShadowQuadXRender( XRenderPicture *picture, QRect rect, f void ShadowEffect::drawShadow( EffectWindow* window, int mask, QRegion region, const WindowPaintData& data ) { + // Don't allow windows to cast shadows on other displays + QRegion clipperGeom; + for( int screen = 0; screen < effects->numScreens(); screen++ ) + { + QRect screenGeom = effects->clientArea( ScreenArea, screen, 0 ); + if( !( window->geometry() & screenGeom ).isNull() ) + clipperGeom |= screenGeom; + } + PaintClipper pc( clipperGeom ); + #ifdef KWIN_HAVE_OPENGL_COMPOSITING if( effects->compositingType() == OpenGLCompositing ) {