Add an advanced option to override kwin's compositing checks

(i.e. currently it allows to enable compositing even if self-check fails).
Not recommended of course, and it's be still nice to get self-check work
reliably.
CCBUG: 170085


svn path=/trunk/KDE/kdebase/workspace/; revision=860196
icc-effect-5.14.5
Luboš Luňák 2008-09-12 10:26:19 +00:00
parent 8eedfa3456
commit 23724e35b2
5 changed files with 23 additions and 1 deletions

View File

@ -50,6 +50,7 @@ KWinAdvancedCompositingOptions::KWinAdvancedCompositingOptions(QWidget* parent,
connect(ui.compositingType, SIGNAL(currentIndexChanged(int)), this, SLOT(changed()));
connect(ui.windowThumbnails, SIGNAL(activated(int)), this, SLOT(changed()));
connect(ui.disableChecks, SIGNAL(toggled(bool)), this, SLOT(changed()));
connect(ui.glMode, SIGNAL(currentIndexChanged(int)), this, SLOT(changed()));
connect(ui.glTextureFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(changed()));
connect(ui.glDirect, SIGNAL(toggled(bool)), this, SLOT(changed()));
@ -131,6 +132,7 @@ void KWinAdvancedCompositingOptions::load()
ui.windowThumbnails->setCurrentIndex( 2 );
else // shown, or default
ui.windowThumbnails->setCurrentIndex( 1 );
ui.disableChecks->setChecked( config.readEntry( "DisableChecks", false ));
QString glMode = config.readEntry("GLMode", "TFP");
ui.glMode->setCurrentIndex((glMode == "TFP") ? 0 : ((glMode == "SHM") ? 1 : 2));
@ -160,7 +162,8 @@ void KWinAdvancedCompositingOptions::save()
|| config.readEntry("GLMode", "TFP") != glModes[ui.glMode->currentIndex()]
|| config.readEntry("GLDirect", mDefaultPrefs->enableDirectRendering())
!= ui.glDirect->isChecked()
|| config.readEntry("GLVSync", mDefaultPrefs->enableVSync()) != ui.glVSync->isChecked())
|| config.readEntry("GLVSync", mDefaultPrefs->enableVSync()) != ui.glVSync->isChecked()
|| config.readEntry("DisableChecks", false ) != ui.disableChecks->isChecked())
{
showConfirm = true;
}
@ -168,6 +171,7 @@ void KWinAdvancedCompositingOptions::save()
config.writeEntry("Backend", (ui.compositingType->currentIndex() == 0) ? "OpenGL" : "XRender");
static const int hps[] = { 1 /*always*/, 3 /*shown*/, 0 /*never*/ };
config.writeEntry("HiddenPreviews", hps[ ui.windowThumbnails->currentIndex() ] );
config.writeEntry("DisableChecks", ui.disableChecks->isChecked());
config.writeEntry("GLMode", glModes[ui.glMode->currentIndex()]);
config.writeEntry("GLTextureFilter", ui.glTextureFilter->currentIndex());

View File

@ -65,6 +65,17 @@
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="disableChecks" >
<property name="whatsThis" >
<string>Enabling this option allows compositing to be activated even if some of the internal checks fail. Doing so may make the whole desktop unusable and its use is not recommened. Use only if KWin refuses to activate compositing on a system that should be capable of compositing.
</string>
</property>
<property name="text" >
<string>Disable functionality checks</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="glGroup" >
<property name="title" >

View File

@ -211,6 +211,7 @@ void Options::reloadCompositingSettings(const CompositingPrefs& prefs)
compositingMode = XRenderCompositing;
else
compositingMode = OpenGLCompositing;
disableCompositingChecks = config.readEntry("DisableChecks", false);
QString glmode = config.readEntry("GLMode", "TFP" ).toUpper();
if( glmode == "TFP" )
glMode = GLTFP;

View File

@ -295,6 +295,7 @@ class Options : public KDecorationOptions
CompositingType compositingMode;
HiddenPreviews hiddenPreviews;
bool unredirectFullscreen;
bool disableCompositingChecks;
uint refreshRate;
// This is for OpenGL mode

View File

@ -696,6 +696,11 @@ bool SceneOpenGL::selfCheck()
wspace->hideOverlay();
if( ok )
kDebug( 1212 ) << "Compositing self-check passed.";
if( !ok && options->disableCompositingChecks )
{
kWarning( 1212 ) << "Compositing checks disabled, proceeding regardless of self-check failure.";
return true;
}
return ok;
}