From e433f9237429d20a8a6edb1f30ba0606c5fd3290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Tue, 23 Sep 2008 14:51:21 +0000 Subject: [PATCH] Avoid useless repeated processing of checking whether to unredirect. svn path=/trunk/KDE/kdebase/workspace/; revision=863933 --- composite.cpp | 2 ++ scene.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/composite.cpp b/composite.cpp index e8cdadd757..6ca0edc453 100644 --- a/composite.cpp +++ b/composite.cpp @@ -839,6 +839,8 @@ bool Toplevel::updateUnredirectedState() void Toplevel::suspendUnredirect( bool suspend ) { + if( unredirectSuspend == suspend ) + return; unredirectSuspend = suspend; workspace()->checkUnredirect(); } diff --git a/scene.cpp b/scene.cpp index cdb5b52863..ea16c5b7e4 100644 --- a/scene.cpp +++ b/scene.cpp @@ -227,7 +227,6 @@ void Scene::paintSimpleScreen( int orig_mask, QRegion region ) --i ) { Window* w = stacking_order[ i ]; - w->suspendUnredirect( true ); WindowPrePaintData data; data.mask = orig_mask | ( w->isOpaque() ? PAINT_WINDOW_OPAQUE : PAINT_WINDOW_TRANSLUCENT ); w->resetPaintingEnabled(); @@ -244,7 +243,10 @@ void Scene::paintSimpleScreen( int orig_mask, QRegion region ) kFatal( 1212 ) << "PAINT_WINDOW_TRANSFORMED without PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS!"; #endif if( !w->isPaintingEnabled()) + { + w->suspendUnredirect( true ); continue; + } if( data.paint != region ) // prepaint added area to draw painted_region |= data.paint; // make sure it makes it to the screen // Schedule the window for painting