diff --git a/kcmkwin/kwincompositing/main.cpp b/kcmkwin/kwincompositing/main.cpp index 787991a29c..cd38277232 100644 --- a/kcmkwin/kwincompositing/main.cpp +++ b/kcmkwin/kwincompositing/main.cpp @@ -136,6 +136,17 @@ KWinCompositingConfig::KWinCompositingConfig(QWidget *parent, const QVariantList #define XRENDER_INDEX -1 #endif + ui.glSwapStrategy->addItem(i18n("None"), "n"); + ui.glSwapStrategy->setItemData(0, i18n("The painting is not synchronized with the screen."), Qt::ToolTipRole); + ui.glSwapStrategy->addItem(i18n("Automatic"), "a"); + ui.glSwapStrategy->setItemData(1, i18n("Tries to re-use older buffers and if that is not possible,\npicks a stragtegy matching your hardware."), Qt::ToolTipRole); + ui.glSwapStrategy->addItem(i18n("Only when Cheap"), "e"); + ui.glSwapStrategy->setItemData(2, i18n("When major regions of the screen are updated,\nthe entire screen will be repainted.\nCan cause tearing with small updates."), Qt::ToolTipRole); + ui.glSwapStrategy->addItem(i18n("Full scene repaints"), "p"); + ui.glSwapStrategy->setItemData(3, i18n("The complete screen is repainted for every frame.\nCan be slow with large blurred areas."), Qt::ToolTipRole); + ui.glSwapStrategy->addItem(i18n("Re-use screen content"), "c"); + ui.glSwapStrategy->setItemData(4, i18n("WARNING:\nThis strategy is usually slow with Open Source drivers.\nUndamaged pixels will be copied from GL_FRONT to GL_BACK"), Qt::ToolTipRole); + connect(ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int))); connect(ui.rearmGlSupportButton, SIGNAL(clicked()), this, SLOT(rearmGlSupport())); @@ -160,7 +171,8 @@ KWinCompositingConfig::KWinCompositingConfig(QWidget *parent, const QVariantList connect(ui.glScaleFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(changed())); connect(ui.xrScaleFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(changed())); - connect(ui.glVSync, SIGNAL(toggled(bool)), this, SLOT(changed())); + connect(ui.glSwapStrategy, SIGNAL(currentIndexChanged(int)), this, SLOT(glSwapStrategyChanged(int))); + connect(ui.glSwapStrategy, SIGNAL(currentIndexChanged(int)), this, SLOT(changed())); connect(ui.glShaders, SIGNAL(toggled(bool)), this, SLOT(changed())); connect(ui.glColorCorrection, SIGNAL(toggled(bool)), this, SLOT(changed())); connect(m_showDetailedErrors, SIGNAL(triggered(bool)), SLOT(showDetailedEffectLoadingInformation())); @@ -337,6 +349,11 @@ void KWinCompositingConfig::loadGeneralTab() ui.desktopSwitchingCombo->setCurrentIndex(3); } +void KWinCompositingConfig::glSwapStrategyChanged(int idx) +{ + ui.glSwapStrategy->setToolTip(ui.glSwapStrategy->itemData(idx, Qt::ToolTipRole).toString()); +} + void KWinCompositingConfig::rearmGlSupport() { // rearm config @@ -357,7 +374,6 @@ void KWinCompositingConfig::suggestGraphicsSystem() ui.graphicsSystem->setCurrentIndex(0); } - void KWinCompositingConfig::toogleSmoothScaleUi(int compositingType) { ui.glScaleFilter->setVisible(compositingType == OPENGL_INDEX); @@ -416,7 +432,10 @@ void KWinCompositingConfig::loadAdvancedTab() ui.xrScaleFilter->setCurrentIndex((int)config.readEntry("XRenderSmoothScale", false)); ui.glScaleFilter->setCurrentIndex(config.readEntry("GLTextureFilter", 2)); - ui.glVSync->setChecked(config.readEntry("GLVSync", true)); + int swapStrategy = ui.glSwapStrategy->findData(config.readEntry("GLPreferBufferSwap", "a")); + if (swapStrategy < 0) + swapStrategy = ui.glSwapStrategy->findData("n"); + ui.glSwapStrategy->setCurrentIndex(swapStrategy); ui.glShaders->setChecked(!config.readEntry("GLLegacy", false)); ui.glColorCorrection->setChecked(config.readEntry("GLColorCorrection", false)); @@ -530,7 +549,7 @@ bool KWinCompositingConfig::saveAdvancedTab() if (config.readEntry("Backend", "OpenGL") != ((ui.compositingType->currentIndex() == OPENGL_INDEX) ? "OpenGL" : "XRender") - || config.readEntry("GLVSync", true) != ui.glVSync->isChecked() + || ((config.readEntry("GLPreferBufferSwap", "a") == "n") xor (ui.glSwapStrategy->itemData(ui.glSwapStrategy->currentIndex()) == "n")) || config.readEntry("GLLegacy", false) == ui.glShaders->isChecked()) { m_showConfirmDialog = true; advancedChanged = true; @@ -550,7 +569,7 @@ bool KWinCompositingConfig::saveAdvancedTab() config.writeEntry("XRenderSmoothScale", ui.xrScaleFilter->currentIndex() == 1); config.writeEntry("GLTextureFilter", ui.glScaleFilter->currentIndex()); - config.writeEntry("GLVSync", ui.glVSync->isChecked()); + config.writeEntry("GLPreferBufferSwap", ui.glSwapStrategy->itemData(ui.glSwapStrategy->currentIndex()).toString()); config.writeEntry("GLLegacy", !ui.glShaders->isChecked()); config.writeEntry("GLColorCorrection", ui.glColorCorrection->isChecked()); @@ -820,7 +839,7 @@ void KWinCompositingConfig::defaults() ui.unredirectFullscreen->setChecked(false); ui.xrScaleFilter->setCurrentIndex(0); ui.glScaleFilter->setCurrentIndex(2); - ui.glVSync->setChecked(true); + ui.glSwapStrategy->setCurrentIndex(ui.glSwapStrategy->findData("a")); ui.glShaders->setChecked(true); ui.glColorCorrection->setChecked(false); } diff --git a/kcmkwin/kwincompositing/main.h b/kcmkwin/kwincompositing/main.h index d806531776..20592b4030 100644 --- a/kcmkwin/kwincompositing/main.h +++ b/kcmkwin/kwincompositing/main.h @@ -78,6 +78,7 @@ public slots: private slots: void confirmReInit() { showConfirmDialog(true); } + void glSwapStrategyChanged(int idx); void rearmGlSupport(); void suggestGraphicsSystem(); void toogleSmoothScaleUi(int compositingType); diff --git a/kcmkwin/kwincompositing/main.ui b/kcmkwin/kwincompositing/main.ui index 57fe31535e..0c781c9246 100644 --- a/kcmkwin/kwincompositing/main.ui +++ b/kcmkwin/kwincompositing/main.ui @@ -10,7 +10,7 @@ 541 - + @@ -24,7 +24,7 @@ - 0 + 2 @@ -514,81 +514,18 @@ - - - - - - - 1 - 0 - - - - Compositing type: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - compositingType - - - - - - - - 3 - 0 - - - - - OpenGL - - - - - XRender - - - - - - - - Qt graphics system: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Segoe'; font-size:8pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">It is <span style=" font-weight:600;">strongly recommended</span> to use the <span style=" font-weight:600;">native</span> system when using the <span style=" font-weight:600;">XRender</span> backend.</p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">On the other hand, many decorations perform better with the <span style=" font-weight:600;">raster</span> system on the <span style=" font-weight:600;">default and generally preferred OpenGL</span> backend (though some don't - also the impact here can be anything between &quot;slight&quot; and &quot;incredible&quot; depending on the GPU and driver)</p></body></html> - - - - Native - - - - - Raster - - - - - + + + + Qt::Horizontal + + + + 40 + 20 + + + @@ -603,6 +540,94 @@ p, li { white-space: pre-wrap; } + + + + + 0 + 0 + + + + OpenGL Options + + + true + + + + + + + + Tearing Prevention (VSync) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + glSwapStrategy + + + + + + + + + + + + If enabled all rendering will be performed with Shaders written in the OpenGL Shading Language. +On legacy hardware disabling Shaders can improve the performance. + + + Use OpenGL 2 Shaders + + + + + + + false + + + <p>Activates color correction if possible, using the Kolor-Manager. Requires OpenGL 2 Shaders to be enabled and Kolor-Manager to be installed. May fail silently.</p><p><strong>Experimental</strong>.</p> + + + Enable color correction (experimental) + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -765,19 +790,6 @@ p, li { white-space: pre-wrap; } - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -791,71 +803,6 @@ p, li { white-space: pre-wrap; } - - - - - 0 - 0 - - - - OpenGL Options - - - true - - - - - - If enabled all rendering will be performed with Shaders written in the OpenGL Shading Language. -On legacy hardware disabling Shaders can improve the performance. - - - Use OpenGL 2 Shaders - - - - - - - Use VSync - - - false - - - - - - - false - - - <p>Activates color correction if possible, using the Kolor-Manager. Requires OpenGL 2 Shaders to be enabled and Kolor-Manager to be installed. May fail silently.</p><p><strong>Experimental</strong>.</p> - - - Enable color correction (experimental) - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -869,6 +816,82 @@ On legacy hardware disabling Shaders can improve the performance. + + + + + + + 1 + 0 + + + + Compositing type: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + compositingType + + + + + + + + 3 + 0 + + + + + OpenGL + + + + + XRender + + + + + + + + Qt graphics system: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Segoe'; font-size:8pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">It is <span style=" font-weight:600;">strongly recommended</span> to use the <span style=" font-weight:600;">native</span> system when using the <span style=" font-weight:600;">XRender</span> backend.</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">On the other hand, many decorations perform better with the <span style=" font-weight:600;">raster</span> system on the <span style=" font-weight:600;">default and generally preferred OpenGL</span> backend (though some don't - also the impact here can be anything between &quot;slight&quot; and &quot;incredible&quot; depending on the GPU and driver)</p></body></html> + + + + Native + + + + + Raster + + + + + + @@ -883,6 +906,8 @@ On legacy hardware disabling Shaders can improve the performance. + groupBox_3 + glGroup @@ -924,11 +949,24 @@ On legacy hardware disabling Shaders can improve the performance. tabWidget + rearmSafetyCheck + rearmGlSupportButton useCompositing effectWinManagement effectAnimations desktopSwitchingCombo animationSpeedCombo + effectSelector + ghns + compositingType + graphicsSystem + windowThumbnails + xrScaleFilter + glScaleFilter + unredirectFullscreen + glShaders + glSwapStrategy + glColorCorrection @@ -959,8 +997,8 @@ On legacy hardware disabling Shaders can improve the performance. 315 - 204 - 358 + 307 + 375