use recommendation from compositing prefs only if there's

no explicit choice (because of driver crashes)


svn path=/trunk/KDE/kdebase/workspace/; revision=1058248
This commit is contained in:
Luboš Luňák 2009-12-04 09:29:08 +00:00
parent 37fbc26205
commit 7cef1eadd5
5 changed files with 34 additions and 25 deletions

View file

@ -33,7 +33,7 @@ namespace KWin
CompositingPrefs::CompositingPrefs()
: mXgl( false )
, mEnableCompositing( false )
, mRecommendCompositing( false )
, mEnableVSync( true )
, mEnableDirectRendering( true )
, mStrictBinding( true )
@ -44,9 +44,9 @@ CompositingPrefs::~CompositingPrefs()
{
}
bool CompositingPrefs::enableCompositing() const
bool CompositingPrefs::recommendCompositing() const
{
return mEnableCompositing;
return mRecommendCompositing;
}
bool CompositingPrefs::compositingPossible()
@ -321,7 +321,7 @@ void CompositingPrefs::applyDriverSpecificOptions()
if( mXgl )
{
kDebug( 1212 ) << "xgl, enabling";
mEnableCompositing = true;
mRecommendCompositing = true;
mStrictBinding = false;
}
else if( mDriver == "intel" )
@ -334,12 +334,12 @@ void CompositingPrefs::applyDriverSpecificOptions()
if( mGLRenderer.contains( "Intel(R) 9" ))
{ // Enable compositing by default on 900-series cards
kDebug( 1212 ) << "intel >= 20061017 and 900-series card, enabling compositing";
mEnableCompositing = true;
mRecommendCompositing = true;
}
if( mGLRenderer.contains( "Mesa DRI Intel(R) G" ))
{ // e.g. G43 chipset
kDebug( 1212 ) << "intel >= 20061017 and Gxx-series card, enabling compositing";
mEnableCompositing = true;
mRecommendCompositing = true;
}
}
}
@ -349,7 +349,7 @@ void CompositingPrefs::applyDriverSpecificOptions()
if( mVersion >= Version( "173.14.12" ))
{
kDebug( 1212 ) << "nvidia >= 173.14.12, enabling compositing";
mEnableCompositing = true;
mRecommendCompositing = true;
}
}
else if( mDriver == "radeon" )
@ -357,12 +357,12 @@ void CompositingPrefs::applyDriverSpecificOptions()
if( mGLRenderer.startsWith( "Mesa DRI R200" ) && mVersion >= Version( "20060602" )) // krazy:exclude=strings
{
kDebug( 1212 ) << "radeon r200 >= 20060602, enabling compositing";
mEnableCompositing = true;
mRecommendCompositing = true;
}
if( mGLRenderer.startsWith( "Mesa DRI R300" ) && mVersion >= Version( "20090101" )) // krazy:exclude=strings
{
kDebug( 1212 ) << "radeon r300 >= 20090101, enabling compositing";
mEnableCompositing = true;
mRecommendCompositing = true;
}
if( mGLRenderer.startsWith( "Mesa DRI R600" ) )
{
@ -372,7 +372,7 @@ void CompositingPrefs::applyDriverSpecificOptions()
if( major > 7 || ( major == 7 && minor >= 7 ) )
{
kDebug( 1212 ) << "Radeon R600/R700, Mesa 7.7 or better. Enabling compositing.";
mEnableCompositing = true;
mRecommendCompositing = true;
}
}
}
@ -381,7 +381,7 @@ void CompositingPrefs::applyDriverSpecificOptions()
if( mVersion >= Version( "2.1.7412" ))
{
kDebug( 1212 ) << "fglrx >= 2.1.7412, enabling compositing";
mEnableCompositing = true;
mRecommendCompositing = true;
}
}
}

View file

@ -54,7 +54,7 @@ public:
static bool compositingPossible();
static QString compositingNotPossibleReason();
bool validateSetup( CompositingType compositingType ) const;
bool enableCompositing() const; // recommendCompositing()?
bool recommendCompositing() const;
bool enableVSync() const { return mEnableVSync; }
bool enableDirectRendering() const { return mEnableDirectRendering; }
bool strictBinding() const { return mStrictBinding; }
@ -85,7 +85,7 @@ private:
Version mVersion;
bool mXgl;
bool mEnableCompositing;
bool mRecommendCompositing;
bool mEnableVSync;
bool mEnableDirectRendering;
bool mStrictBinding;

View file

@ -317,7 +317,7 @@ void KWinCompositingConfig::currentTabChanged(int tab)
void KWinCompositingConfig::loadGeneralTab()
{
KConfigGroup config(mKWinConfig, "Compositing");
bool enabled = config.readEntry("Enabled", mDefaultPrefs.enableCompositing());
bool enabled = config.readEntry("Enabled", mDefaultPrefs.recommendCompositing());
ui.useCompositing->setChecked( enabled );
ui.animationSpeedCombo->setCurrentIndex(config.readEntry("AnimationSpeed", 3 ));
@ -473,7 +473,7 @@ void KWinCompositingConfig::saveGeneralTab()
KConfigGroup config(mKWinConfig, "Compositing");
// Check if any critical settings that need confirmation have changed
if(ui.useCompositing->isChecked() &&
ui.useCompositing->isChecked() != config.readEntry("Enabled", mDefaultPrefs.enableCompositing()))
ui.useCompositing->isChecked() != config.readEntry("Enabled", mDefaultPrefs.recommendCompositing()))
m_showConfirmDialog = true;
config.writeEntry("Enabled", ui.useCompositing->isChecked());
@ -674,7 +674,7 @@ void KWinCompositingConfig::checkLoadedEffects()
QDBusMessage message = QDBusMessage::createMethodCall( "org.kde.kwin", "/KWin", "org.kde.KWin", "loadedEffects" );
QDBusMessage reply = QDBusConnection::sessionBus().call( message );
KConfigGroup effectConfig = KConfigGroup( mKWinConfig, "Compositing" );
bool enabledAfter = effectConfig.readEntry( "Enabled", mDefaultPrefs.enableCompositing() );
bool enabledAfter = effectConfig.readEntry( "Enabled", mDefaultPrefs.recommendCompositing() );
if( reply.type() == QDBusMessage::ReplyMessage && enabledAfter && !getenv( "KDE_FAILSAFE" ))
{
@ -734,7 +734,7 @@ void KWinCompositingConfig::defaults()
{
ui.tabWidget->setCurrentIndex(0);
ui.useCompositing->setChecked(mDefaultPrefs.enableCompositing());
ui.useCompositing->setChecked(mDefaultPrefs.recommendCompositing());
ui.effectWinManagement->setChecked(true);
ui.effectShadows->setChecked(true);
ui.effectAnimations->setChecked(true);

View file

@ -64,9 +64,17 @@ KWinScreenEdgesConfig::KWinScreenEdgesConfig( QWidget* parent, const QVariantLis
connect( m_ui->quickMaximizeBox, SIGNAL( stateChanged(int) ), this, SLOT( groupChanged() ));
connect( m_ui->quickTileBox, SIGNAL( stateChanged(int) ), this, SLOT( groupChanged() ));
if( CompositingPrefs::compositingPossible() )
// NOTICE: this is intended to workaround broken GL implementations that succesfully segfault on glXQuery :-(
KConfigGroup gl_workaround_config(m_config, "Compositing");
const bool checkIsSafe = gl_workaround_config.readEntry("CheckIsSafe", true);
if( checkIsSafe && CompositingPrefs::compositingPossible() )
{
gl_workaround_config.writeEntry("CheckIsSafe", false);
gl_workaround_config.sync();
m_defaultPrefs.detect(); // Driver-specific config detection
gl_workaround_config.writeEntry("CheckIsSafe", true);
gl_workaround_config.sync();
}
load();
}
@ -413,7 +421,7 @@ void KWinScreenEdgesConfig::monitorShowEvent()
{
// Check if they are enabled
KConfigGroup config( m_config, "Compositing" );
if( config.readEntry( "Enabled", m_defaultPrefs.enableCompositing() ))
if( config.readEntry( "Enabled", m_defaultPrefs.recommendCompositing() ))
{ // Compositing enabled
config = KConfigGroup( m_config, "Plugins" );

View file

@ -229,12 +229,13 @@ void Options::reloadCompositingSettings()
// Compositing settings
CompositingPrefs prefs;
useCompositing = config.readEntry("Enabled", true);
if (useCompositing)
{
if( !config.hasKey( "Enabled" ))
{
prefs.detect();
useCompositing = prefs.enableCompositing();
}
useCompositing = prefs.recommendCompositing();
}
else
useCompositing = config.readEntry( "Enabled" , true );
if (!useCompositing)
return;