From ad60dbfdb9010a2c02a1eb146e3b8c04b37695f7 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:58:34 +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. svn path=/branches/KDE/4.1/kdebase/workspace/; revision=850943 --- composite.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/composite.cpp b/composite.cpp index 6104455f5f..7daa220391 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