Don't needlessly setup compositing twice during startup.

Xrandr seems to like to send events about "changes" right
after application startup.


svn path=/trunk/KDE/kdebase/workspace/; revision=923829
icc-effect-5.14.5
Luboš Luňák 2009-02-09 14:31:42 +00:00
parent 657288d7b6
commit 4d82d2291e
4 changed files with 13 additions and 7 deletions

View File

@ -175,10 +175,8 @@ void Workspace::setupCompositing()
{ // autoconfigure refresh rate based on XRandR info
if( Extensions::randrAvailable() )
{
XRRScreenConfiguration *config;
config = XRRGetScreenInfo( display(), rootWindow() );
rate = XRRConfigCurrentRate( config );
XRRScreenConfiguration *config = XRRGetScreenInfo( display(), rootWindow() );
rate = xrrRefreshRate = XRRConfigCurrentRate( config );
XRRFreeScreenConfigInfo( config );
}
}

View File

@ -501,15 +501,21 @@ bool Workspace::workspaceEvent( XEvent * e )
{
#ifdef HAVE_XRANDR
XRRUpdateConfiguration( e );
#endif
if( compositing() )
{
// desktopResized() should take care of when the size or
// shape of the desktop has changed, but we also want to
// catch refresh rate changes
finishCompositing();
QTimer::singleShot( 0, this, SLOT( setupCompositing() ) );
XRRScreenConfiguration *config = XRRGetScreenInfo( display(), rootWindow() );
bool changed = ( xrrRefreshRate != XRRConfigCurrentRate( config ));
XRRFreeScreenConfigInfo( config );
if( changed )
{
finishCompositing();
QTimer::singleShot( 0, this, SLOT( setupCompositing() ) );
}
}
#endif
}
else if( e->type == Extensions::syncAlarmNotifyEvent() && Extensions::syncAvailable())
{

View File

@ -139,6 +139,7 @@ Workspace::Workspace( bool restore )
, cm_selection( NULL )
, compositingSuspended( false )
, compositeRate( 0 )
, xrrRefreshRate( 0 )
, overlay( None )
, overlay_visible( true )
, overlay_shown( false )

View File

@ -774,6 +774,7 @@ class Workspace : public QObject, public KDecorationDefines
QTime nextPaintReference;
QTimer mousePollingTimer;
int compositeRate;
int xrrRefreshRate; // used only for compositing
QRegion repaints_region;
Window overlay; // XComposite overlay window
bool overlay_visible;