From ffc4bc5040486b8a4e6f62c664a7527dbcd47492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Fri, 22 Aug 2008 15:57:31 +0000 Subject: [PATCH] Make sure idling does not actually cause big load by a repeating quick timer caused by dynamically adjusting the next repaint when using vsync. Ideally there should be no idle ticks at all, somewhen later. BUG: 154270 CCBUG: 155694 svn path=/trunk/KDE/kdebase/workspace/; revision=850941 --- composite.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/composite.cpp b/composite.cpp index 8fbd617ac2..04633765a5 100644 --- a/composite.cpp +++ b/composite.cpp @@ -314,6 +314,11 @@ void Workspace::performCompositing() || !overlay_visible ) // nothing is visible anyway { scene->idle(); + // With vsync, next repaint is scheduled dynamically at the end of this function, + // and it can have a very short timeout. If we now idle here, make sure the idling + // does not actually caused heavy load by firing the timer often too quickly. + if( compositeTimer.interval() != compositeRate ) + compositeTimer.start( compositeRate ); return; } // create a list of all windows in the stacking order