From 42941eba8a52de5d48136c41e57f792b4e5f0571 Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Thu, 28 Apr 2011 11:34:50 -0400 Subject: [PATCH] kwin: Fix the clip intersection code (XRender) Do not process windows if the clip region does not intersect the window region --- scene_xrender.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scene_xrender.cpp b/scene_xrender.cpp index 228e71cba6..13e9b72f85 100644 --- a/scene_xrender.cpp +++ b/scene_xrender.cpp @@ -613,6 +613,12 @@ void SceneXrender::Window::performPaint(int mask, QRegion region, WindowPaintDat if ( mask & PAINT_WINDOW_TRANSLUCENT && opaque ) return; // Only painting translucent and window is opaque }*/ + // Intersect the clip region with the rectangle the window occupies on the screen + if (!(mask & (PAINT_WINDOW_TRANSFORMED | PAINT_SCREEN_TRANSFORMED))) + region &= toplevel->visibleRect(); + + if (region.isEmpty()) + return; Picture pic = picture(); // get XRender picture if (pic == None) // The render format can be null for GL and/or Xv visuals return;