From b50a8d352a50a2a5ec5890d0c7e811db78fc6619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Mon, 9 Feb 2009 14:37:07 +0000 Subject: [PATCH] Compress possible several reasons for resetting compositing. svn path=/trunk/KDE/kdebase/workspace/; revision=923836 --- events.cpp | 5 +---- geometry.cpp | 5 +---- workspace.cpp | 2 ++ workspace.h | 1 + 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/events.cpp b/events.cpp index c8e99288a7..d419dbc684 100644 --- a/events.cpp +++ b/events.cpp @@ -510,10 +510,7 @@ bool Workspace::workspaceEvent( XEvent * e ) bool changed = ( xrrRefreshRate != XRRConfigCurrentRate( config )); XRRFreeScreenConfigInfo( config ); if( changed ) - { - finishCompositing(); - QTimer::singleShot( 0, this, SLOT( setupCompositing() ) ); - } + compositeResetTimer.start( 0 ); } #endif } diff --git a/geometry.cpp b/geometry.cpp index 6c8b554876..ad5ac12a58 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -65,10 +65,7 @@ void Workspace::desktopResized() destroyElectricBorders(); updateElectricBorders(); if( compositing() ) - { - finishCompositing(); - QTimer::singleShot( 0, this, SLOT( setupCompositing() ) ); - } + compositeResetTimer.start( 0 ); } /*! diff --git a/workspace.cpp b/workspace.cpp index b40cddab5d..1ec5ca2eff 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -172,7 +172,9 @@ Workspace::Workspace( bool restore ) this, SLOT( gotTemporaryRulesMessage(const QString&) )); connect( &rulesUpdatedTimer, SIGNAL( timeout() ), this, SLOT( writeWindowRules() )); connect( &unredirectTimer, SIGNAL( timeout() ), this, SLOT( delayedCheckUnredirect() )); + connect( &compositeResetTimer, SIGNAL( timeout()), this, SLOT( resetCompositing())); unredirectTimer.setSingleShot( true ); + compositeResetTimer.setSingleShot( true ); updateXTime(); // Needed for proper initialization of user_time in Client ctor diff --git a/workspace.h b/workspace.h index 396b92a1c0..d6c474eb30 100644 --- a/workspace.h +++ b/workspace.h @@ -785,6 +785,7 @@ class Workspace : public QObject, public KDecorationDefines QTimer unredirectTimer; bool forceUnredirectCheck; QList< int > composite_paint_times; + QTimer compositeResetTimer; // for compressing composite resets private: friend bool performTransiencyCheck();