From a20ba6a9009d797f5204b0175cf490524cd4fd52 Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Thu, 25 Jun 2009 10:09:09 +0000 Subject: [PATCH] Prevent KWin from automatically disabling compositing when the user changes the system time or timezone. BUG: 184607 svn path=/trunk/KDE/kdebase/workspace/; revision=986962 --- composite.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/composite.cpp b/composite.cpp index d981f1f00d..04cf62a760 100644 --- a/composite.cpp +++ b/composite.cpp @@ -493,6 +493,13 @@ void Workspace::checkCompositePaintTime( int msec ) { if( options->disableCompositingChecks ) return; + // Sanity check. QTime uses the system clock so if the user changes the time or + // timezone our timer will return undefined results. Ideally we would use a system + // clock independent timer but I am uncertain if Qt provides a nice wrapper for + // one or not. As it's unlikely for a single paint to take 15 seconds it seems + // like a good upper bound. + if( msec < 0 || msec > 15000 ) + return; composite_paint_times.prepend( msec ); bool tooslow = false; // If last 3 paints were way too slow, disable and warn.