diff --git a/kcmkwin/kwincompositing/compositing.cpp b/kcmkwin/kwincompositing/compositing.cpp index 62fa779e4b..dfba04c56e 100644 --- a/kcmkwin/kwincompositing/compositing.cpp +++ b/kcmkwin/kwincompositing/compositing.cpp @@ -113,6 +113,12 @@ int Compositing::glSwapStrategy() const } } +bool Compositing::glColorCorrection() const +{ + KConfigGroup kwinConfig(KSharedConfig::openConfig("kwinrc"), "Compositing"); + return kwinConfig.readEntry("GLColorCorrection", false); +} + CompositingType::CompositingType(QObject *parent) : QAbstractItemModel(parent) { @@ -221,7 +227,7 @@ int CompositingType::currentOpenGLType() } void CompositingType::syncConfig(int openGLType, int animationSpeed, int windowThumbnail, int glSclaleFilter, bool xrSclaleFilter, - bool unredirectFullscreen, int glSwapStrategy) + bool unredirectFullscreen, int glSwapStrategy, bool glColorCorrection) { QString glSwapStrategyValue; QString backend; @@ -282,6 +288,7 @@ void CompositingType::syncConfig(int openGLType, int animationSpeed, int windowT kwinConfig.writeEntry("XRenderSmoothScale", xrSclaleFilter); kwinConfig.writeEntry("UnredirectFullscreen", unredirectFullscreen); kwinConfig.writeEntry("GLPreferBufferSwap", glSwapStrategyValue); + kwinConfig.writeEntry("GLColorCorrection", glColorCorrection); kwinConfig.sync(); } diff --git a/kcmkwin/kwincompositing/compositing.h b/kcmkwin/kwincompositing/compositing.h index 9229f3a32e..0b37eeba5b 100644 --- a/kcmkwin/kwincompositing/compositing.h +++ b/kcmkwin/kwincompositing/compositing.h @@ -38,6 +38,7 @@ class Compositing : public QObject Q_PROPERTY(bool xrSclaleFilter READ xrSclaleFilter CONSTANT); Q_PROPERTY(bool unredirectFullscreen READ unredirectFullscreen CONSTANT); Q_PROPERTY(int glSwapStrategy READ glSwapStrategy CONSTANT); + Q_PROPERTY(bool glColorCorrection READ glColorCorrection CONSTANT); public: explicit Compositing(QObject *parent = 0); @@ -49,6 +50,7 @@ public: bool xrSclaleFilter() const; bool unredirectFullscreen() const; int glSwapStrategy() const; + bool glColorCorrection() const; private: @@ -93,7 +95,7 @@ public: Q_INVOKABLE int currentOpenGLType(); Q_INVOKABLE void syncConfig(int openGLType, int animationSpeed, int windowThumbnail, int glSclaleFilter, bool xrSclaleFilter, - bool unredirectFullscreen, int glSwapStrategy); + bool unredirectFullscreen, int glSwapStrategy, bool glColorCorrection); private: void generateCompositing(); diff --git a/kcmkwin/kwincompositing/qml/EffectView.qml b/kcmkwin/kwincompositing/qml/EffectView.qml index bf7c0cc5b2..ac19b62f3a 100644 --- a/kcmkwin/kwincompositing/qml/EffectView.qml +++ b/kcmkwin/kwincompositing/qml/EffectView.qml @@ -70,6 +70,7 @@ Item { apply.enabled = true; glScaleFilter.visible = currentIndex != 3; xrScaleFilter.visible = currentIndex == 3; + glColorCorrection.enabled = currentIndex !=3 && glColorCorrection !=4; } } @@ -188,6 +189,18 @@ Item { onCurrentIndexChanged: apply.enabled = true; } + CheckBox { + id: glColorCorrection + text: i18n("Enable color correction (experimental)") + checked: compositing.glColorCorrection + enabled: openGLType.currentIndex != 3 && openGLType.currentIndex != 4 + anchors { + top: glSwapStrategy.bottom + left: col.right + } + onClicked: apply.enabled = true + } + ColumnLayout { id: col height: parent.height @@ -267,7 +280,8 @@ Item { onClicked: { searchModel.syncConfig(); apply.enabled = false; - compositingType.syncConfig(openGLType.currentIndex, animationSpeed.value, windowThumbnail.currentIndex, glScaleFilter.currentIndex, xrScaleFilter.currentIndex == 1, unredirectFullScreen.checked, glSwapStrategy.currentIndex); + compositingType.syncConfig(openGLType.currentIndex, animationSpeed.value, windowThumbnail.currentIndex, glScaleFilter.currentIndex, xrScaleFilter.currentIndex == 1, + unredirectFullScreen.checked, glSwapStrategy.currentIndex, glColorCorrection.checked); } }