be more strict about acceptable frame intervals - system time really *can* change without notice.

svn path=/trunk/KDE/kdebase/workspace/; revision=859340
This commit is contained in:
Andreas Hartmetz 2008-09-10 04:35:28 +00:00
parent 56a323877e
commit af3b302b05

View file

@ -407,8 +407,8 @@ void Workspace::setCompositeTimer()
if( !compositing()) // should not really happen, but there may be e.g. some damage events still pending if( !compositing()) // should not really happen, but there may be e.g. some damage events still pending
return; return;
// The last paint set nextPaintReference as a reference time to which multiples of compositeRate // The last paint set nextPaintReference as a reference time to which multiples of compositeRate
// should be added for the next paint. qMax() is a guard against negative moduli when the day changes. // should be added for the next paint. qBound() for protection; system time can change without notice.
compositeTimer.start( qMax ( 0, nextPaintReference.msecsTo( QTime::currentTime()) % compositeRate ) ); compositeTimer.start( qBound( 0, nextPaintReference.msecsTo( QTime::currentTime() ), 250 ) % compositeRate );
} }
bool Workspace::createOverlay() bool Workspace::createOverlay()