From bdc3cc556444519def2cdecb00455af9ba4dee3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Tue, 8 Nov 2011 20:53:17 +0100 Subject: [PATCH] skip empty damages, reset damageRatio also when pixmaps are created --- composite.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composite.cpp b/composite.cpp index bc29233079..aa721b84c2 100644 --- a/composite.cpp +++ b/composite.cpp @@ -558,6 +558,7 @@ Pixmap Toplevel::createWindowPixmap() assert(compositing()); if (unredirected()) return None; + damageRatio = 0.0; grabXServer(); KXErrorHandler err; Pixmap pix = XCompositeNameWindowPixmap(display(), frameId()); @@ -667,6 +668,8 @@ void Toplevel::addDamage(int x, int y, int w, int h) // resizing the decoration may lag behind a bit and when shrinking there // may be a damage event coming with size larger than the current window size r &= rect(); + if (r.isEmpty()) + return; damage_region += r; int damageArea = 0; foreach (const QRect &r2, damage_region.rects())