Skip to content

Commit

Permalink
Diabled backbuffering choice on any other system than X11
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn authored and mhugent committed Aug 9, 2012
1 parent 677cea0 commit 295c464
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/app/qgsoptions.cpp
Expand Up @@ -230,8 +230,10 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
cmbScanZipInBrowser->setCurrentIndex( index );

// Set the enable backbuffer state
#ifdef Q_WS_X11
chkEnableBackbuffer->setChecked( settings.value( "/Map/enableBackbuffer" ).toBool() );
toggleEnableBackbuffer( chkEnableBackbuffer->checkState() );
#endif

// set the display update threshold
spinBoxUpdateThreshold->setValue( settings.value( "/Map/updateThreshold" ).toInt() );
Expand Down Expand Up @@ -726,6 +728,7 @@ void QgsOptions::toggleStandardDeviation( int state )
}
}

#ifdef Q_WS_X11
void QgsOptions::toggleEnableBackbuffer( int state )
{
if ( Qt::Checked == state )
Expand All @@ -739,6 +742,7 @@ void QgsOptions::toggleEnableBackbuffer( int state )
spinBoxUpdateThreshold->setEnabled( true );
}
}
#endif

QString QgsOptions::theme()
{
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -957,7 +957,9 @@ bool QgsVectorLayer::draw( QgsRenderContext& rendererContext )
//set update threshold before each draw to make sure the current setting is picked up
QSettings settings;
mUpdateThreshold = settings.value( "Map/updateThreshold", 0 ).toInt();
#ifdef Q_WS_X11
mEnableBackbuffer = settings.value( "/Map/enableBackbuffer", 1 ).toBool();
#endif

if ( mUsingRendererV2 )
{
Expand Down
5 changes: 4 additions & 1 deletion src/gui/qgsmapcanvas.cpp
Expand Up @@ -371,8 +371,11 @@ void QgsMapCanvas::refresh()
return;

QSettings settings;
#ifdef Q_WS_X11
bool enableBackbufferSetting = settings.value( "/Map/enableBackbuffer", 1 ).toBool();

#else
bool enableBackbufferSetting = 0;
#endif

//disable the update that leads to the resize crash
if ( viewport() )
Expand Down

0 comments on commit 295c464

Please sign in to comment.