Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package kde-gtk-config5 for openSUSE:Factory 
checked in at 2023-02-13 16:39:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kde-gtk-config5 (Old)
 and      /work/SRC/openSUSE:Factory/.kde-gtk-config5.new.1848 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kde-gtk-config5"

Mon Feb 13 16:39:39 2023 rev:146 rq:1064507 version:5.27.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/kde-gtk-config5/kde-gtk-config5.changes  
2023-01-06 17:03:55.827633735 +0100
+++ 
/work/SRC/openSUSE:Factory/.kde-gtk-config5.new.1848/kde-gtk-config5.changes    
    2023-02-13 16:41:43.247658753 +0100
@@ -1,0 +2,22 @@
+Thu Feb  9 14:19:38 UTC 2023 - Fabian Vogt <[email protected]>
+
+- Update to 5.27.0
+  * New bugfix release
+  * For more details please see:
+  * https://kde.org/announcements/plasma/5/5.27.0
+- Changes since 5.26.90:
+  * Set DPI scaling settings for GTK on Plasma/X11 sessions (kde#442901)
+
+-------------------------------------------------------------------
+Thu Jan 19 14:42:36 UTC 2023 - Fabian Vogt <[email protected]>
+
+- Update to 5.26.90
+  * New feature release
+  * For more details please see:
+  * https://kde.org/announcements/plasma/5/5.26.90
+- Changes since 5.26.5:
+  * Provide implementation for DecoratedClient::windowClass()
+  * refactor: split config editor into smaller editors
+  * kded: properly delete factory to fix file descriptor leak 
(kde#458430,kde#458817)
+
+-------------------------------------------------------------------

Old:
----
  kde-gtk-config-5.26.5.tar.xz
  kde-gtk-config-5.26.5.tar.xz.sig

New:
----
  kde-gtk-config-5.27.0.tar.xz
  kde-gtk-config-5.27.0.tar.xz.sig

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kde-gtk-config5.spec ++++++
--- /var/tmp/diff_new_pack.mUOLqm/_old  2023-02-13 16:41:43.663661204 +0100
+++ /var/tmp/diff_new_pack.mUOLqm/_new  2023-02-13 16:41:43.667661227 +0100
@@ -18,15 +18,15 @@
 
 %bcond_without released
 Name:           kde-gtk-config5
-Version:        5.26.5
+Version:        5.27.0
 Release:        0
 Summary:        Daemon for GTK2 and GTK3 Applications Appearance Under KDE
 License:        GPL-3.0-or-later AND LGPL-3.0-or-later
 Group:          System/GUI/KDE
 URL:            http://projects.kde.org/kde-gtk-config
-Source:         
https://download.kde.org/stable/plasma/%{version}/kde-gtk-config-%{version}.tar.xz
+Source:         kde-gtk-config-%{version}.tar.xz
 %if %{with released}
-Source1:        
https://download.kde.org/stable/plasma/%{version}/kde-gtk-config-%{version}.tar.xz.sig
+Source1:        kde-gtk-config-%{version}.tar.xz.sig
 Source2:        plasma.keyring
 %endif
 BuildRequires:  extra-cmake-modules >= 5.98.0
@@ -41,6 +41,7 @@
 BuildRequires:  cmake(KF5DBusAddons)
 BuildRequires:  cmake(KF5GuiAddons)
 BuildRequires:  cmake(KF5IconThemes)
+BuildRequires:  cmake(KF5WindowSystem)
 BuildRequires:  cmake(Qt5Svg) >= 5.15.0
 BuildRequires:  pkgconfig(gio-2.0)
 BuildRequires:  pkgconfig(glib-2.0)

++++++ kde-gtk-config-5.26.5.tar.xz -> kde-gtk-config-5.27.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.26.5/.kde-ci.yml 
new/kde-gtk-config-5.27.0/.kde-ci.yml
--- old/kde-gtk-config-5.26.5/.kde-ci.yml       2023-01-03 19:00:55.000000000 
+0100
+++ new/kde-gtk-config-5.27.0/.kde-ci.yml       2023-02-09 12:59:08.000000000 
+0100
@@ -13,6 +13,7 @@
     'frameworks/kdbusaddons': '@latest'
     'frameworks/kguiaddons': '@latest'
     'frameworks/kwidgetsaddons': '@latest'
+    'frameworks/kwindowsystem': '@latest'
     'plasma/kdecoration': '@same'
 Options:
   require-passing-tests-on: [ 'Linux', 'FreeBSD']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.26.5/CMakeLists.txt 
new/kde-gtk-config-5.27.0/CMakeLists.txt
--- old/kde-gtk-config-5.26.5/CMakeLists.txt    2023-01-03 19:00:55.000000000 
+0100
+++ new/kde-gtk-config-5.27.0/CMakeLists.txt    2023-02-09 12:59:08.000000000 
+0100
@@ -1,9 +1,9 @@
 project(kde-gtk-config)
-set(PROJECT_VERSION "5.26.5")
+set(PROJECT_VERSION "5.27.0")
 cmake_minimum_required(VERSION 3.16)
 
 set(QT_MIN_VERSION "5.15.2")
-set(KF5_MIN_VERSION "5.98.0")
+set(KF5_MIN_VERSION "5.102.0")
 set(KDE_COMPILERSETTINGS_LEVEL "5.82")
 
 set(CMAKE_CXX_STANDARD 17)
@@ -24,7 +24,7 @@
 include(KDEGitCommitHooks)
 
 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED NO_MODULE 
COMPONENTS DBus Svg)
-find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons Config 
ConfigWidgets GuiAddons DBusAddons)
+find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons Config 
ConfigWidgets GuiAddons DBusAddons WindowSystem)
 find_package(PkgConfig REQUIRED)
 find_package(KDecoration2 REQUIRED)
 find_package(GSettingSchemas REQUIRED)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.26.5/kconf_update/CMakeLists.txt 
new/kde-gtk-config-5.27.0/kconf_update/CMakeLists.txt
--- old/kde-gtk-config-5.26.5/kconf_update/CMakeLists.txt       2023-01-03 
19:00:55.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kconf_update/CMakeLists.txt       2023-02-09 
12:59:08.000000000 +0100
@@ -1,4 +1,14 @@
-add_executable(gtk_theme gtktheme.cpp ../kded/configeditor.cpp)
+add_executable(gtk_theme)
+
+target_sources (gtk_theme
+  PRIVATE
+    gtktheme.cpp
+    ../kded/config_editor/gsettings.cpp
+    ../kded/config_editor/gtk2.cpp
+    ../kded/config_editor/settings_ini.cpp
+    ../kded/config_editor/utils.cpp
+    ../kded/config_editor/xsettings.cpp
+)
 
 target_link_libraries(gtk_theme
   PRIVATE
@@ -29,7 +39,8 @@
 
 add_executable(remove_deprecated_gtk4_option
   remove_deprecated_gtk4_option.cpp
-   ../kded/configeditor.cpp
+   ../kded/config_editor/settings_ini.cpp
+   ../kded/config_editor/utils.cpp
 )
 
 target_link_libraries(remove_deprecated_gtk4_option
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.26.5/kconf_update/gtktheme.cpp 
new/kde-gtk-config-5.27.0/kconf_update/gtktheme.cpp
--- old/kde-gtk-config-5.26.5/kconf_update/gtktheme.cpp 2023-01-03 
19:00:55.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kconf_update/gtktheme.cpp 2023-02-09 
12:59:08.000000000 +0100
@@ -9,7 +9,10 @@
 #include <QString>
 #include <QVariant>
 
-#include "configeditor.h"
+#include "config_editor/gsettings.h"
+#include "config_editor/gtk2.h"
+#include "config_editor/settings_ini.h"
+#include "config_editor/xsettings.h"
 
 QString gtk2Theme();
 void upgradeGtk2Theme();
@@ -29,20 +32,20 @@
         || currentGtk2Theme == QStringLiteral("oxygen-gtk") //
         || currentGtk2Theme == QStringLiteral("BreezyGTK") //
         || currentGtk2Theme == QStringLiteral("Orion")) {
-        ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-theme-name"), 
QStringLiteral("Breeze"));
+        Gtk2ConfigEditor::setValue(QStringLiteral("gtk-theme-name"), 
QStringLiteral("Breeze"));
     }
 }
 
 void upgradeGtk3Theme()
 {
-    QString currentGtk3Theme = 
ConfigEditor::gtk3ConfigValueSettingsIni(QStringLiteral("gtk-theme-name"));
+    QString currentGtk3Theme = 
SettingsIniEditor::value(QStringLiteral("gtk-theme-name"), 3);
     if (currentGtk3Theme.isEmpty() //
         || currentGtk3Theme == QStringLiteral("oxygen-gtk") //
         || currentGtk3Theme == QStringLiteral("BreezyGTK") //
         || currentGtk3Theme == QStringLiteral("Orion")) {
-        ConfigEditor::setGtkConfigValueGSettings(QStringLiteral("gtk-theme"), 
QStringLiteral("Breeze"));
-        
ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-theme-name"), 
QStringLiteral("Breeze"));
-        
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Net/ThemeName"), 
QStringLiteral("Breeze"));
+        GSettingsEditor::setValue(QStringLiteral("gtk-theme"), 
QStringLiteral("Breeze"));
+        SettingsIniEditor::setValue(QStringLiteral("gtk-theme-name"), 
QStringLiteral("Breeze"), 3);
+        XSettingsEditor::setValue(QStringLiteral("Net/ThemeName"), 
QStringLiteral("Breeze"));
     }
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kde-gtk-config-5.26.5/kconf_update/remove_deprecated_gtk4_option.cpp 
new/kde-gtk-config-5.27.0/kconf_update/remove_deprecated_gtk4_option.cpp
--- old/kde-gtk-config-5.26.5/kconf_update/remove_deprecated_gtk4_option.cpp    
2023-01-03 19:00:55.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kconf_update/remove_deprecated_gtk4_option.cpp    
2023-02-09 12:59:08.000000000 +0100
@@ -4,12 +4,12 @@
  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR 
LicenseRef-KDE-Accepted-GPL
  */
 
-#include "configeditor.h"
+#include "config_editor/settings_ini.h"
 
 int main()
 {
-    
ConfigEditor::unsetGtk4ConfigValueSettingsIni(QStringLiteral("gtk-button-images"));
-    
ConfigEditor::unsetGtk4ConfigValueSettingsIni(QStringLiteral("gtk-menu-images"));
-    
ConfigEditor::unsetGtk4ConfigValueSettingsIni(QStringLiteral("gtk-toolbar-style"));
+    SettingsIniEditor::unsetValue(QStringLiteral("gtk-button-images"), 4);
+    SettingsIniEditor::unsetValue(QStringLiteral("gtk-menu-images"), 4);
+    SettingsIniEditor::unsetValue(QStringLiteral("gtk-toolbar-style"), 4);
     return 0;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.26.5/kded/CMakeLists.txt 
new/kde-gtk-config-5.27.0/kded/CMakeLists.txt
--- old/kde-gtk-config-5.26.5/kded/CMakeLists.txt       2023-01-03 
19:00:55.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/CMakeLists.txt       2023-02-09 
12:59:08.000000000 +0100
@@ -1,14 +1,16 @@
 add_subdirectory(kwin_bridge)
 add_subdirectory(scss)
 
-set(kscreen_daemon_SRCS
+add_library(gtkconfig MODULE)
+
+target_sources(gtkconfig 
+  PRIVATE
     gtkconfig.cpp
-    configeditor.cpp
     configvalueprovider.cpp
     themepreviewer.cpp
 )
 
-add_library(gtkconfig MODULE ${kscreen_daemon_SRCS})
+add_subdirectory(config_editor)
 
 target_compile_definitions(gtkconfig
   PUBLIC
@@ -18,6 +20,7 @@
 target_link_libraries(gtkconfig
   PRIVATE
     KWinBridge
+    KF5::WindowSystem
   PUBLIC
     Qt::DBus
     Qt::Svg
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kde-gtk-config-5.26.5/kded/config_editor/CMakeLists.txt 
new/kde-gtk-config-5.27.0/kded/config_editor/CMakeLists.txt
--- old/kde-gtk-config-5.26.5/kded/config_editor/CMakeLists.txt 1970-01-01 
01:00:00.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/config_editor/CMakeLists.txt 2023-02-09 
12:59:08.000000000 +0100
@@ -0,0 +1,12 @@
+# SPDX-FileCopyrightText: 2022 Mikhail Zolotukhin <[email protected]>
+# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR 
LicenseRef-KDE-Accepted-GPL
+
+target_sources(gtkconfig 
+  PRIVATE 
+    custom_css.cpp 
+    gsettings.cpp 
+    gtk2.cpp
+    settings_ini.cpp 
+    utils.cpp
+    xsettings.cpp
+)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kde-gtk-config-5.26.5/kded/config_editor/custom_css.cpp 
new/kde-gtk-config-5.27.0/kded/config_editor/custom_css.cpp
--- old/kde-gtk-config-5.26.5/kded/config_editor/custom_css.cpp 1970-01-01 
01:00:00.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/config_editor/custom_css.cpp 2023-02-09 
12:59:08.000000000 +0100
@@ -0,0 +1,138 @@
+// SPDX-FileCopyrightText: 2019, 2022 Mikhail Zolotukhin 
<[email protected]>
+// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR 
LicenseRef-KDE-Accepted-GPL
+
+#include "custom_css.h"
+
+#include <QDir>
+#include <QFile>
+#include <QStandardPaths>
+#include <QTextStream>
+
+#include "config_editor/settings_ini.h"
+#include "config_editor/utils.h"
+
+namespace CustomCssEditor
+{
+namespace
+{
+
+void saveWindowDecorationsToAssets(const QStringList 
&windowDecorationsButtonsImages)
+{
+    for (auto gtkVersion : Utils::s_gtkVersions) {
+        auto assetsFolderPath = Utils::configDirPath(gtkVersion) + 
QStringLiteral("/assets");
+        auto assetsFolder = QDir(assetsFolderPath);
+
+        if (!assetsFolder.exists()) {
+            assetsFolder.mkpath(QStringLiteral("."));
+        }
+
+        for (const auto &buttonImagePath : windowDecorationsButtonsImages) {
+            const QString destination = assetsFolder.path() + '/' + 
QFileInfo(buttonImagePath).fileName();
+            QFile(destination).remove();
+            QFile(buttonImagePath).copy(buttonImagePath, destination);
+        }
+
+        for (const auto &buttonImagePath : windowDecorationsButtonsImages) {
+            QFile(buttonImagePath).remove();
+        }
+    }
+}
+
+void addWindowDecorationsCssFile()
+{
+    for (auto gtkVersion : Utils::s_gtkVersions) {
+        QFile 
windowDecorationsCss{QStandardPaths::locate(QStandardPaths::GenericDataLocation,
 QStringLiteral("/themes/Breeze/window_decorations.css"))};
+
+        auto windowDecorationsDestination = Utils::configDirPath(gtkVersion) + 
QStringLiteral("/window_decorations.css");
+
+        QFile(windowDecorationsDestination).remove();
+        windowDecorationsCss.copy(windowDecorationsDestination);
+    }
+}
+
+void addGtkModule(const QString &moduleName)
+{
+    const QString currentModulesString = 
SettingsIniEditor::value(QStringLiteral("gtk-modules"));
+
+    if (currentModulesString.contains(moduleName)) {
+        return;
+    }
+
+    if (currentModulesString.isEmpty()) { // No modules
+        SettingsIniEditor::setValue(QStringLiteral("gtk-modules"), moduleName);
+    } else {
+        SettingsIniEditor::setValue(QStringLiteral("gtk-modules"), 
QStringLiteral("%1:%2").arg(currentModulesString, moduleName));
+    }
+}
+
+void addImportStatementsToGtkCssUserFile()
+{
+    for (auto gtkVersion : Utils::s_gtkVersions) {
+        auto gtkCssPath = Utils::configDirPath(gtkVersion) + 
QStringLiteral("/gtk.css");
+        QFile gtkCss(gtkCssPath);
+
+        if (gtkCss.open(QIODevice::ReadWrite)) {
+            QByteArray gtkCssContents = gtkCss.readAll().trimmed();
+
+            static const QVector<QByteArray> importStatements{
+                QByteArrayLiteral("\n@import 'colors.css';"),
+            };
+
+            for (const auto &statement : importStatements) {
+                if (!gtkCssContents.contains(statement.trimmed())) {
+                    gtkCssContents.append(statement);
+                }
+            }
+
+            gtkCss.remove();
+            gtkCss.open(QIODevice::WriteOnly | QIODevice::Text);
+            gtkCss.write(gtkCssContents);
+        }
+    }
+}
+
+void removeWindowDecorationsCSS()
+{
+    for (auto gtkVersion : Utils::s_gtkVersions) {
+        QFile windowsDecorationsCss(Utils::configDirPath(gtkVersion) + 
QStringLiteral("/window_decorations.css"));
+        windowsDecorationsCss.remove();
+    }
+}
+
+void modifyColorsCssFile(const QMap<QString, QColor> &colorsDefinitions)
+{
+    for (auto gtkVersion : Utils::s_gtkVersions) {
+        QString colorsCssPath = Utils::configDirPath(gtkVersion) + 
QStringLiteral("/colors.css");
+        QFile colorsCss(colorsCssPath);
+
+        if (colorsCss.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
+            QTextStream colorsCssStream(&colorsCss);
+
+            for (auto it = colorsDefinitions.cbegin(); it != 
colorsDefinitions.cend(); it++) {
+                colorsCssStream << QStringLiteral("@define-color %1 
%2;\n").arg(it.key(), it.value().name());
+            }
+        }
+    }
+}
+}
+
+void setColors(const QMap<QString, QColor> &colorsDefinitions)
+{
+    addImportStatementsToGtkCssUserFile();
+    modifyColorsCssFile(colorsDefinitions);
+    addGtkModule(QStringLiteral("colorreload-gtk-module"));
+}
+
+void setCustomClientSideDecorations(const QStringList 
&windowDecorationsButtonsImages)
+{
+    saveWindowDecorationsToAssets(windowDecorationsButtonsImages);
+    addWindowDecorationsCssFile();
+    addGtkModule(QStringLiteral("window-decorations-gtk-module"));
+}
+
+void disableCustomClientSideDecorations()
+{
+    removeWindowDecorationsCSS();
+}
+
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kde-gtk-config-5.26.5/kded/config_editor/custom_css.h 
new/kde-gtk-config-5.27.0/kded/config_editor/custom_css.h
--- old/kde-gtk-config-5.26.5/kded/config_editor/custom_css.h   1970-01-01 
01:00:00.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/config_editor/custom_css.h   2023-02-09 
12:59:08.000000000 +0100
@@ -0,0 +1,16 @@
+// SPDX-FileCopyrightText: 2019, 2022 Mikhail Zolotukhin 
<[email protected]>
+// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR 
LicenseRef-KDE-Accepted-GPL
+
+#pragma once
+
+#include <QColor>
+#include <QString>
+
+namespace CustomCssEditor
+{
+
+void setColors(const QMap<QString, QColor> &colorsDefinitions);
+void setCustomClientSideDecorations(const QStringList 
&windowDecorationsButtonsImages);
+void disableCustomClientSideDecorations();
+
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kde-gtk-config-5.26.5/kded/config_editor/gsettings.cpp 
new/kde-gtk-config-5.27.0/kded/config_editor/gsettings.cpp
--- old/kde-gtk-config-5.26.5/kded/config_editor/gsettings.cpp  1970-01-01 
01:00:00.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/config_editor/gsettings.cpp  2023-02-09 
12:59:08.000000000 +0100
@@ -0,0 +1,31 @@
+// SPDX-FileCopyrightText: 2019, 2022 Mikhail Zolotukhin 
<[email protected]>
+// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR 
LicenseRef-KDE-Accepted-GPL
+
+#include "gsettings.h"
+
+#include <gio/gio.h>
+
+namespace GSettingsEditor
+{
+void setValue(const QString &paramName, const QVariant &paramValue, const 
QString &category)
+{
+    g_autoptr(GSettings) gsettings = 
g_settings_new(category.toUtf8().constData());
+
+    if (paramValue.type() == QVariant::Type::String) {
+        g_settings_set_string(gsettings, paramName.toUtf8().constData(), 
paramValue.toString().toUtf8().constData());
+    } else if (paramValue.type() == QVariant::Type::Int) {
+        g_settings_set_int(gsettings, paramName.toUtf8().constData(), 
paramValue.toInt());
+    } else if (paramValue.type() == QVariant::Type::Bool) {
+        g_settings_set_boolean(gsettings, paramName.toUtf8().constData(), 
paramValue.toBool());
+    }
+
+    g_settings_sync();
+}
+
+void setValueAsEnum(const QString &paramName, int paramValue, const QString 
&category)
+{
+    g_autoptr(GSettings) gsettings = 
g_settings_new(category.toUtf8().constData());
+    g_settings_set_enum(gsettings, paramName.toUtf8().constData(), paramValue);
+    g_settings_sync();
+}
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.26.5/kded/config_editor/gsettings.h 
new/kde-gtk-config-5.27.0/kded/config_editor/gsettings.h
--- old/kde-gtk-config-5.26.5/kded/config_editor/gsettings.h    1970-01-01 
01:00:00.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/config_editor/gsettings.h    2023-02-09 
12:59:08.000000000 +0100
@@ -0,0 +1,13 @@
+// SPDX-FileCopyrightText: 2019, 2022 Mikhail Zolotukhin 
<[email protected]>
+// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR 
LicenseRef-KDE-Accepted-GPL
+
+#pragma once
+
+#include <QString>
+#include <QVariant>
+
+namespace GSettingsEditor
+{
+void setValue(const QString &paramName, const QVariant &paramValue, const 
QString &category = QStringLiteral("org.gnome.desktop.interface"));
+void setValueAsEnum(const QString &paramName, int paramValue, const QString 
&category = QStringLiteral("org.gnome.desktop.interface"));
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.26.5/kded/config_editor/gtk2.cpp 
new/kde-gtk-config-5.27.0/kded/config_editor/gtk2.cpp
--- old/kde-gtk-config-5.26.5/kded/config_editor/gtk2.cpp       1970-01-01 
01:00:00.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/config_editor/gtk2.cpp       2023-02-09 
12:59:08.000000000 +0100
@@ -0,0 +1,79 @@
+// SPDX-FileCopyrightText: 2019, 2022 Mikhail Zolotukhin 
<[email protected]>
+// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR 
LicenseRef-KDE-Accepted-GPL
+
+#include "gtk2.h"
+
+#include <QDir>
+#include <QRegularExpression>
+
+#include "config_editor/utils.h"
+
+namespace Gtk2ConfigEditor
+{
+namespace
+{
+
+void replaceValueInGtkrcContents(QString &gtkrcContents, const QString 
&paramName, const QVariant &paramValue)
+{
+    const QRegularExpression regExp(paramName + 
QStringLiteral("=[^\n]*($|\n)"));
+
+    QString newConfigString;
+    if (paramValue.type() == QVariant::Type::String) {
+        newConfigString = QStringLiteral("%1=\"%2\"\n").arg(paramName, 
paramValue.toString());
+    } else if (paramValue.type() == QVariant::Type::Bool) {
+        // GTK2 does not support 'true' and 'false' as values
+        newConfigString = QStringLiteral("%1=%2\n").arg(paramName, 
QString::number(paramValue.toInt()));
+    } else {
+        newConfigString = QStringLiteral("%1=%2\n").arg(paramName, 
paramValue.toString());
+    }
+
+    if (gtkrcContents.contains(regExp)) {
+        gtkrcContents.replace(regExp, newConfigString);
+    } else {
+        gtkrcContents = newConfigString + gtkrcContents;
+    }
+}
+}
+
+void setValue(const QString &paramName, const QVariant &paramValue)
+{
+    QString gtkrcPath = qEnvironmentVariable("GTK2_RC_FILES", QDir::homePath() 
+ QStringLiteral("/.gtkrc-2.0"));
+    if (gtkrcPath.contains(QStringLiteral(":/"))) { // I.e. env variable 
contains multiple paths
+        gtkrcPath = QDir::homePath() + QStringLiteral("/.gtkrc-2.0");
+    }
+    QFile gtkrc(gtkrcPath);
+    QString gtkrcContents = Utils::readFileContents(gtkrc);
+    replaceValueInGtkrcContents(gtkrcContents, paramName, paramValue);
+    gtkrc.remove();
+    gtkrc.open(QIODevice::WriteOnly | QIODevice::Text);
+    gtkrc.write(gtkrcContents.toUtf8());
+}
+
+void removeLegacyStrings()
+{
+    QString gtkrcPath = QDir::homePath() + QStringLiteral("/.gtkrc-2.0");
+    QFile gtkrc(gtkrcPath);
+    QString gtkrcContents = Utils::readFileContents(gtkrc);
+
+    // Remove "include" lines
+    // Example:
+    // include "/usr/share/themes/Adwaita-dark/gtk-2.0/gtkrc"
+    static const QRegularExpression includeRegExp(QStringLiteral("include 
.*\n"));
+    gtkrcContents.remove(includeRegExp);
+
+    // Remove redundant font config lines
+    // Example:
+    // style "user-font"
+    // {
+    //     font_name="Noto Sans Regular"
+    // }
+    // widget_class "*" style "user-font"
+    static const QRegularExpression 
userFontStyleRegexp(QStringLiteral("style(.|\n)*{(.|\n)*}\nwidget_class.*\"user-font\""));
+    gtkrcContents.remove(userFontStyleRegexp);
+
+    gtkrc.remove();
+    gtkrc.open(QIODevice::WriteOnly | QIODevice::Text);
+    gtkrc.write(gtkrcContents.toUtf8());
+}
+
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.26.5/kded/config_editor/gtk2.h 
new/kde-gtk-config-5.27.0/kded/config_editor/gtk2.h
--- old/kde-gtk-config-5.26.5/kded/config_editor/gtk2.h 1970-01-01 
01:00:00.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/config_editor/gtk2.h 2023-02-09 
12:59:08.000000000 +0100
@@ -0,0 +1,13 @@
+// SPDX-FileCopyrightText: 2019, 2022 Mikhail Zolotukhin 
<[email protected]>
+// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR 
LicenseRef-KDE-Accepted-GPL
+
+#pragma once
+
+#include <QString>
+#include <QVariant>
+
+namespace Gtk2ConfigEditor
+{
+void setValue(const QString &paramName, const QVariant &paramValue);
+void removeLegacyStrings();
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kde-gtk-config-5.26.5/kded/config_editor/settings_ini.cpp 
new/kde-gtk-config-5.27.0/kded/config_editor/settings_ini.cpp
--- old/kde-gtk-config-5.26.5/kded/config_editor/settings_ini.cpp       
1970-01-01 01:00:00.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/config_editor/settings_ini.cpp       
2023-02-09 12:59:08.000000000 +0100
@@ -0,0 +1,75 @@
+// SPDX-FileCopyrightText: 2019, 2022 Mikhail Zolotukhin 
<[email protected]>
+// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR 
LicenseRef-KDE-Accepted-GPL
+
+#include "settings_ini.h"
+
+#include <KConfigGroup>
+#include <KSharedConfig>
+
+#include <QStandardPaths>
+
+#include "config_editor/utils.h"
+
+namespace SettingsIniEditor
+{
+
+namespace
+{
+
+KConfigGroup gtkConfigGroup(int gtkVersion)
+{
+    QString configLocation = 
QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
+    auto gtkConfigPath = 
QStringLiteral("%1/gtk-%2.0/settings.ini").arg(configLocation).arg(gtkVersion);
+
+    KSharedConfig::Ptr gtkConfig = KSharedConfig::openConfig(gtkConfigPath, 
KConfig::NoGlobals);
+    return gtkConfig->group(QStringLiteral("Settings"));
+}
+}
+
+void setValue(const QString &paramName, const QVariant &paramValue, int 
gtkVersion)
+{
+    auto setValueForVersion = [&](int version) {
+        auto group = gtkConfigGroup(version);
+        group.writeEntry(paramName, paramValue);
+        group.sync();
+    };
+
+    if (gtkVersion != -1) {
+        setValueForVersion(gtkVersion);
+        return;
+    }
+
+    for (auto version : Utils::s_gtkVersions) {
+        setValueForVersion(version);
+    }
+}
+
+void unsetValue(const QString &paramName, int gtkVersion)
+{
+    auto unsetValueForVersion = [&](int version) {
+        auto group = gtkConfigGroup(version);
+        group.deleteEntry(paramName);
+        group.sync();
+    };
+
+    if (gtkVersion != -1) {
+        unsetValueForVersion(gtkVersion);
+        return;
+    }
+
+    for (auto version : Utils::s_gtkVersions) {
+        unsetValueForVersion(version);
+    }
+}
+
+QString value(const QString &paramName, int gtkVersion)
+{
+    if (gtkVersion == -1) {
+        gtkVersion = *Utils::s_gtkVersions.begin();
+    }
+
+    auto group = gtkConfigGroup(gtkVersion);
+    return group.readEntry(paramName);
+}
+
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kde-gtk-config-5.26.5/kded/config_editor/settings_ini.h 
new/kde-gtk-config-5.27.0/kded/config_editor/settings_ini.h
--- old/kde-gtk-config-5.26.5/kded/config_editor/settings_ini.h 1970-01-01 
01:00:00.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/config_editor/settings_ini.h 2023-02-09 
12:59:08.000000000 +0100
@@ -0,0 +1,14 @@
+// SPDX-FileCopyrightText: 2019, 2022 Mikhail Zolotukhin 
<[email protected]>
+// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR 
LicenseRef-KDE-Accepted-GPL
+
+#pragma once
+
+#include <QString>
+#include <QVariant>
+
+namespace SettingsIniEditor
+{
+void setValue(const QString &paramName, const QVariant &paramValue, int 
gtkVersion = -1);
+void unsetValue(const QString &paramName, int gtkVersion = -1);
+QString value(const QString &paramName, int gtkVersion = -1);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.26.5/kded/config_editor/utils.cpp 
new/kde-gtk-config-5.27.0/kded/config_editor/utils.cpp
--- old/kde-gtk-config-5.26.5/kded/config_editor/utils.cpp      1970-01-01 
01:00:00.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/config_editor/utils.cpp      2023-02-09 
12:59:08.000000000 +0100
@@ -0,0 +1,26 @@
+// SPDX-FileCopyrightText: 2019, 2022 Mikhail Zolotukhin 
<[email protected]>
+// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR 
LicenseRef-KDE-Accepted-GPL
+
+#include "utils.h"
+
+#include <QStandardPaths>
+
+namespace Utils
+{
+
+QString configDirPath(int gtkVersion)
+{
+    auto configLocation = 
QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
+    return QStringLiteral("%1/gtk-%2.0").arg(configLocation).arg(gtkVersion);
+};
+
+QString readFileContents(QFile &file)
+{
+    if (file.open(QIODevice::ReadWrite | QIODevice::Text)) {
+        return file.readAll();
+    } else {
+        return QString();
+    }
+}
+
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.26.5/kded/config_editor/utils.h 
new/kde-gtk-config-5.27.0/kded/config_editor/utils.h
--- old/kde-gtk-config-5.26.5/kded/config_editor/utils.h        1970-01-01 
01:00:00.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/config_editor/utils.h        2023-02-09 
12:59:08.000000000 +0100
@@ -0,0 +1,15 @@
+// SPDX-FileCopyrightText: 2019, 2022 Mikhail Zolotukhin 
<[email protected]>
+// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR 
LicenseRef-KDE-Accepted-GPL
+
+#pragma once
+
+#include <QFile>
+#include <QString>
+
+namespace Utils
+{
+QString configDirPath(int gtkVersion);
+QString readFileContents(QFile &file);
+
+[[maybe_unused]] static inline const auto s_gtkVersions = {3, 4};
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kde-gtk-config-5.26.5/kded/config_editor/xsettings.cpp 
new/kde-gtk-config-5.27.0/kded/config_editor/xsettings.cpp
--- old/kde-gtk-config-5.26.5/kded/config_editor/xsettings.cpp  1970-01-01 
01:00:00.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/config_editor/xsettings.cpp  2023-02-09 
12:59:08.000000000 +0100
@@ -0,0 +1,80 @@
+// SPDX-FileCopyrightText: 2019, 2022 Mikhail Zolotukhin 
<[email protected]>
+// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR 
LicenseRef-KDE-Accepted-GPL
+
+#include "xsettings.h"
+
+#include <QDir>
+#include <QProcess>
+#include <QRegularExpression>
+#include <QStandardPaths>
+
+#include <csignal>
+
+#include "config_editor/utils.h"
+
+namespace XSettingsEditor
+{
+namespace
+{
+void replaceValueInXSettingsdContents(QString &xSettingsdContents, const 
QString &paramName, const QVariant &paramValue)
+{
+    const QRegularExpression regExp(paramName + QStringLiteral(" 
[^\n]*($|\n)"));
+
+    QString newConfigString;
+    if (paramValue.type() == QVariant::Type::String) {
+        newConfigString = QStringLiteral("%1 \"%2\"\n").arg(paramName, 
paramValue.toString());
+    } else if (paramValue.type() == QVariant::Type::Bool) {
+        // XSettigsd does not support 'true' and 'false' as values
+        newConfigString = QStringLiteral("%1 %2\n").arg(paramName, 
QString::number(paramValue.toInt()));
+    } else {
+        newConfigString = QStringLiteral("%1 %2\n").arg(paramName, 
paramValue.toString());
+    }
+
+    if (xSettingsdContents.contains(regExp)) {
+        xSettingsdContents.replace(regExp, newConfigString);
+    } else {
+        xSettingsdContents = newConfigString + xSettingsdContents;
+    }
+}
+
+pid_t pidOfXSettingsd()
+{
+    QProcess pidof;
+    pidof.start(QStringLiteral("pidof"), QStringList() << QStringLiteral("-s") 
<< QStringLiteral("xsettingsd"));
+    pidof.waitForFinished();
+    QString xsettingsdPid = 
QString(pidof.readAllStandardOutput()).remove('\n');
+    return xsettingsdPid.toInt();
+}
+
+void reloadXSettingsd()
+{
+    pid_t xSettingsdPid = pidOfXSettingsd();
+    if (xSettingsdPid == 0) {
+        
QProcess::startDetached(QStandardPaths::findExecutable(QStringLiteral("xsettingsd")),
 QStringList());
+    } else {
+        kill(xSettingsdPid, SIGHUP);
+    }
+}
+
+}
+
+void setValue(const QString &paramName, const QVariant &paramValue)
+{
+    QString configLocation = 
QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
+
+    QDir xsettingsdPath = configLocation + QStringLiteral("/xsettingsd");
+    if (!xsettingsdPath.exists()) {
+        xsettingsdPath.mkpath(QStringLiteral("."));
+    }
+
+    QString xSettingsdConfigPath = xsettingsdPath.path() + 
QStringLiteral("/xsettingsd.conf");
+
+    QFile xSettingsdConfig(xSettingsdConfigPath);
+    QString xSettingsdConfigContents = 
Utils::readFileContents(xSettingsdConfig);
+    replaceValueInXSettingsdContents(xSettingsdConfigContents, paramName, 
paramValue);
+    xSettingsdConfig.remove();
+    xSettingsdConfig.open(QIODevice::WriteOnly | QIODevice::Text);
+    xSettingsdConfig.write(xSettingsdConfigContents.toUtf8());
+    reloadXSettingsd();
+}
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.26.5/kded/config_editor/xsettings.h 
new/kde-gtk-config-5.27.0/kded/config_editor/xsettings.h
--- old/kde-gtk-config-5.26.5/kded/config_editor/xsettings.h    1970-01-01 
01:00:00.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/config_editor/xsettings.h    2023-02-09 
12:59:08.000000000 +0100
@@ -0,0 +1,12 @@
+// SPDX-FileCopyrightText: 2019, 2022 Mikhail Zolotukhin 
<[email protected]>
+// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR 
LicenseRef-KDE-Accepted-GPL
+
+#pragma once
+
+#include <QString>
+#include <QVariant>
+
+namespace XSettingsEditor
+{
+void setValue(const QString &paramName, const QVariant &paramValue);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.26.5/kded/configeditor.cpp 
new/kde-gtk-config-5.27.0/kded/configeditor.cpp
--- old/kde-gtk-config-5.26.5/kded/configeditor.cpp     2023-01-03 
19:00:55.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/configeditor.cpp     1970-01-01 
01:00:00.000000000 +0100
@@ -1,333 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2019 Mikhail Zolotukhin <[email protected]>
- *
- * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR 
LicenseRef-KDE-Accepted-GPL
- */
-
-#include <QColor>
-#include <QDir>
-#include <QList>
-#include <QMap>
-#include <QProcess>
-#include <QRegularExpression>
-#include <QStandardPaths>
-#include <QTextStream>
-#include <QVariant>
-
-#include <KColorScheme>
-#include <KColorUtils>
-#include <KConfigGroup>
-#include <KSharedConfig>
-
-#include <csignal>
-#include <cstdio>
-#include <string>
-
-#include <gio/gio.h>
-
-#include "configeditor.h"
-
-namespace
-{
-
-KConfigGroup gtkConfigGroup(const QString &versionString)
-{
-    QString configLocation = 
QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
-    QString gtk3ConfigPath = configLocation + QStringLiteral("/") + 
versionString + QStringLiteral("/settings.ini");
-
-    KSharedConfig::Ptr gtk3Config = KSharedConfig::openConfig(gtk3ConfigPath, 
KConfig::NoGlobals);
-    return gtk3Config->group(QStringLiteral("Settings"));
-}
-
-}
-
-void ConfigEditor::setGtkConfigValueGSettings(const QString &paramName, const 
QVariant &paramValue, const QString &category)
-{
-    g_autoptr(GSettings) gsettings = 
g_settings_new(category.toUtf8().constData());
-
-    if (paramValue.type() == QVariant::Type::String) {
-        g_settings_set_string(gsettings, paramName.toUtf8().constData(), 
paramValue.toString().toUtf8().constData());
-    } else if (paramValue.type() == QVariant::Type::Int) {
-        g_settings_set_int(gsettings, paramName.toUtf8().constData(), 
paramValue.toInt());
-    } else if (paramValue.type() == QVariant::Type::Bool) {
-        g_settings_set_boolean(gsettings, paramName.toUtf8().constData(), 
paramValue.toBool());
-    }
-
-    g_settings_sync();
-}
-
-void ConfigEditor::setGtkConfigValueGSettingsAsEnum(const QString &paramName, 
int paramValue, const QString &category)
-{
-    g_autoptr(GSettings) gsettings = 
g_settings_new(category.toUtf8().constData());
-    g_settings_set_enum(gsettings, paramName.toUtf8().constData(), paramValue);
-    g_settings_sync();
-}
-
-void ConfigEditor::setGtkConfigValueSettingsIni(const QString &versionString, 
const QString &paramName, const QVariant &paramValue)
-{
-    auto group = gtkConfigGroup(versionString);
-    group.writeEntry(paramName, paramValue);
-    group.sync();
-}
-
-void ConfigEditor::unsetGtkConfigValueSettingsIni(const QString 
&versionString, const QString &paramName)
-{
-    auto group = gtkConfigGroup(versionString);
-    group.deleteEntry(paramName);
-    group.sync();
-}
-
-QString ConfigEditor::gtkConfigValueSettingsIni(const QString &versionString, 
const QString &paramName)
-{
-    auto group = gtkConfigGroup(versionString);
-    return group.readEntry(paramName);
-}
-
-void ConfigEditor::setGtk3ConfigValueXSettingsd(const QString &paramName, 
const QVariant &paramValue)
-{
-    QString configLocation = 
QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
-
-    QDir xsettingsdPath = configLocation + QStringLiteral("/xsettingsd");
-    if (!xsettingsdPath.exists()) {
-        xsettingsdPath.mkpath(QStringLiteral("."));
-    }
-
-    QString xSettingsdConfigPath = xsettingsdPath.path() + 
QStringLiteral("/xsettingsd.conf");
-
-    QFile xSettingsdConfig(xSettingsdConfigPath);
-    QString xSettingsdConfigContents = readFileContents(xSettingsdConfig);
-    replaceValueInXSettingsdContents(xSettingsdConfigContents, paramName, 
paramValue);
-    xSettingsdConfig.remove();
-    xSettingsdConfig.open(QIODevice::WriteOnly | QIODevice::Text);
-    xSettingsdConfig.write(xSettingsdConfigContents.toUtf8());
-    reloadXSettingsd();
-}
-
-void ConfigEditor::setGtk2ConfigValue(const QString &paramName, const QVariant 
&paramValue)
-{
-    QString gtkrcPath = qEnvironmentVariable("GTK2_RC_FILES", QDir::homePath() 
+ QStringLiteral("/.gtkrc-2.0"));
-    if (gtkrcPath.contains(QStringLiteral(":/"))) { // I.e. env variable 
contains multiple paths
-        gtkrcPath = QDir::homePath() + QStringLiteral("/.gtkrc-2.0");
-    }
-    QFile gtkrc(gtkrcPath);
-    QString gtkrcContents = readFileContents(gtkrc);
-    replaceValueInGtkrcContents(gtkrcContents, paramName, paramValue);
-    gtkrc.remove();
-    gtkrc.open(QIODevice::WriteOnly | QIODevice::Text);
-    gtkrc.write(gtkrcContents.toUtf8());
-}
-
-void ConfigEditor::setCustomClientSideDecorations(const QStringList 
&windowDecorationsButtonsImages)
-{
-    saveWindowDecorationsToAssets(windowDecorationsButtonsImages);
-    addWindowDecorationsCssFile();
-    addGtkModule(QStringLiteral("window-decorations-gtk-module"));
-}
-
-void ConfigEditor::disableCustomClientSideDecorations()
-{
-    removeWindowDecorationsCSS();
-}
-
-void ConfigEditor::setGtk3Colors(const QMap<QString, QColor> 
&colorsDefinitions)
-{
-    addImportStatementsToGtkCssUserFile();
-    modifyColorsCssFile(colorsDefinitions);
-    addGtkModule(QStringLiteral("colorreload-gtk-module"));
-}
-
-void ConfigEditor::removeLegacyGtk2Strings()
-{
-    QString gtkrcPath = QDir::homePath() + QStringLiteral("/.gtkrc-2.0");
-    QFile gtkrc(gtkrcPath);
-    QString gtkrcContents = readFileContents(gtkrc);
-
-    // Remove "include" lines
-    // Example:
-    // include "/usr/share/themes/Adwaita-dark/gtk-2.0/gtkrc"
-    static const QRegularExpression includeRegExp(QStringLiteral("include 
.*\n"));
-    gtkrcContents.remove(includeRegExp);
-
-    // Remove redundant font config lines
-    // Example:
-    // style "user-font"
-    // {
-    //     font_name="Noto Sans Regular"
-    // }
-    // widget_class "*" style "user-font"
-    static const QRegularExpression 
userFontStyleRegexp(QStringLiteral("style(.|\n)*{(.|\n)*}\nwidget_class.*\"user-font\""));
-    gtkrcContents.remove(userFontStyleRegexp);
-
-    gtkrc.remove();
-    gtkrc.open(QIODevice::WriteOnly | QIODevice::Text);
-    gtkrc.write(gtkrcContents.toUtf8());
-}
-
-void ConfigEditor::saveWindowDecorationsToAssets(const QStringList 
&windowDecorationsButtonsImages)
-{
-    for (const auto &gtkVersionPath : gtkCssVersions) {
-        QDir 
assetsFolder{QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation)
 + gtkVersionPath + QStringLiteral("/assets")};
-
-        if (!assetsFolder.exists()) {
-            assetsFolder.mkpath(QStringLiteral("."));
-        }
-
-        for (const auto &buttonImagePath : windowDecorationsButtonsImages) {
-            const QString destination = assetsFolder.path() + '/' + 
QFileInfo(buttonImagePath).fileName();
-            QFile(destination).remove();
-            QFile(buttonImagePath).copy(buttonImagePath, destination);
-        }
-    }
-    for (const auto &buttonImagePath : windowDecorationsButtonsImages) {
-        QFile(buttonImagePath).remove();
-    }
-}
-
-void ConfigEditor::addWindowDecorationsCssFile()
-{
-    QFile 
windowDecorationsCss{QStandardPaths::locate(QStandardPaths::GenericDataLocation,
 QStringLiteral("/themes/Breeze/window_decorations.css"))};
-    for (const auto &gtkVersionPath : gtkCssVersions) {
-        QString 
windowDecorationsDestination{QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation)
 + gtkVersionPath
-                                             + 
QStringLiteral("/window_decorations.css")};
-
-        QFile(windowDecorationsDestination).remove();
-        windowDecorationsCss.copy(windowDecorationsDestination);
-    }
-}
-
-void ConfigEditor::addGtkModule(const QString &moduleName)
-{
-    const QString currentModulesString = 
gtk3ConfigValueSettingsIni(QStringLiteral("gtk-modules"));
-
-    if (currentModulesString.contains(moduleName)) {
-        return;
-    }
-
-    if (currentModulesString.isEmpty()) { // No modules
-        setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-modules"), 
moduleName);
-    } else {
-        setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-modules"), 
QStringLiteral("%1:%2").arg(currentModulesString, moduleName));
-    }
-}
-
-void ConfigEditor::addImportStatementsToGtkCssUserFile()
-{
-    for (const auto &gtkVersionPath : gtkCssVersions) {
-        QString gtkCssPath = 
QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + 
gtkVersionPath + QStringLiteral("/gtk.css");
-        QFile gtkCss(gtkCssPath);
-
-        if (gtkCss.open(QIODevice::ReadWrite)) {
-            QByteArray gtkCssContents = gtkCss.readAll().trimmed();
-
-            static const QVector<QByteArray> importStatements{
-                QByteArrayLiteral("\n@import 'colors.css';"),
-            };
-
-            for (const auto &statement : importStatements) {
-                if (!gtkCssContents.contains(statement.trimmed())) {
-                    gtkCssContents.append(statement);
-                }
-            }
-
-            gtkCss.remove();
-            gtkCss.open(QIODevice::WriteOnly | QIODevice::Text);
-            gtkCss.write(gtkCssContents);
-        }
-    }
-}
-
-void ConfigEditor::removeWindowDecorationsCSS()
-{
-    using SP = QStandardPaths;
-
-    for (const auto &gtkVersionPath : gtkCssVersions) {
-        QFile 
windowsDecorationsCss(SP::writableLocation(SP::GenericConfigLocation) + 
gtkVersionPath + QStringLiteral("/window_decorations.css"));
-        windowsDecorationsCss.remove();
-    }
-}
-
-void ConfigEditor::modifyColorsCssFile(const QMap<QString, QColor> 
&colorsDefinitions)
-{
-    for (const auto &gtkVersionPath : gtkCssVersions) {
-        QString colorsCssPath = 
QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + 
gtkVersionPath + QStringLiteral("/colors.css");
-        QFile colorsCss(colorsCssPath);
-
-        if (colorsCss.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
-            QTextStream colorsCssStream(&colorsCss);
-
-            for (auto it = colorsDefinitions.cbegin(); it != 
colorsDefinitions.cend(); it++) {
-                colorsCssStream << QStringLiteral("@define-color %1 
%2;\n").arg(it.key(), it.value().name());
-            }
-        }
-    }
-}
-
-QString ConfigEditor::readFileContents(QFile &file)
-{
-    if (file.open(QIODevice::ReadWrite | QIODevice::Text)) {
-        return file.readAll();
-    } else {
-        return QString();
-    }
-}
-
-void ConfigEditor::replaceValueInGtkrcContents(QString &gtkrcContents, const 
QString &paramName, const QVariant &paramValue)
-{
-    const QRegularExpression regExp(paramName + 
QStringLiteral("=[^\n]*($|\n)"));
-
-    QString newConfigString;
-    if (paramValue.type() == QVariant::Type::String) {
-        newConfigString = QStringLiteral("%1=\"%2\"\n").arg(paramName, 
paramValue.toString());
-    } else if (paramValue.type() == QVariant::Type::Bool) {
-        // GTK2 does not support 'true' and 'false' as values
-        newConfigString = QStringLiteral("%1=%2\n").arg(paramName, 
QString::number(paramValue.toInt()));
-    } else {
-        newConfigString = QStringLiteral("%1=%2\n").arg(paramName, 
paramValue.toString());
-    }
-
-    if (gtkrcContents.contains(regExp)) {
-        gtkrcContents.replace(regExp, newConfigString);
-    } else {
-        gtkrcContents = newConfigString + gtkrcContents;
-    }
-}
-
-void ConfigEditor::replaceValueInXSettingsdContents(QString 
&xSettingsdContents, const QString &paramName, const QVariant &paramValue)
-{
-    const QRegularExpression regExp(paramName + QStringLiteral(" 
[^\n]*($|\n)"));
-
-    QString newConfigString;
-    if (paramValue.type() == QVariant::Type::String) {
-        newConfigString = QStringLiteral("%1 \"%2\"\n").arg(paramName, 
paramValue.toString());
-    } else if (paramValue.type() == QVariant::Type::Bool) {
-        // XSettigsd does not support 'true' and 'false' as values
-        newConfigString = QStringLiteral("%1 %2\n").arg(paramName, 
QString::number(paramValue.toInt()));
-    } else {
-        newConfigString = QStringLiteral("%1 %2\n").arg(paramName, 
paramValue.toString());
-    }
-
-    if (xSettingsdContents.contains(regExp)) {
-        xSettingsdContents.replace(regExp, newConfigString);
-    } else {
-        xSettingsdContents = newConfigString + xSettingsdContents;
-    }
-}
-
-pid_t ConfigEditor::pidOfXSettingsd()
-{
-    QProcess pidof;
-    pidof.start(QStringLiteral("pidof"), QStringList() << QStringLiteral("-s") 
<< QStringLiteral("xsettingsd"));
-    pidof.waitForFinished();
-    QString xsettingsdPid = 
QString(pidof.readAllStandardOutput()).remove('\n');
-    return xsettingsdPid.toInt();
-}
-
-void ConfigEditor::reloadXSettingsd()
-{
-    pid_t xSettingsdPid = pidOfXSettingsd();
-    if (xSettingsdPid == 0) {
-        
QProcess::startDetached(QStandardPaths::findExecutable(QStringLiteral("xsettingsd")),
 QStringList());
-    } else {
-        kill(xSettingsdPid, SIGHUP);
-    }
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.26.5/kded/configeditor.h 
new/kde-gtk-config-5.27.0/kded/configeditor.h
--- old/kde-gtk-config-5.26.5/kded/configeditor.h       2023-01-03 
19:00:55.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/configeditor.h       1970-01-01 
01:00:00.000000000 +0100
@@ -1,62 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2019 Mikhail Zolotukhin <[email protected]>
- *
- * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR 
LicenseRef-KDE-Accepted-GPL
- */
-#pragma once
-
-#include <QString>
-#include <functional>
-#include <unistd.h>
-
-class QColor;
-class QFile;
-class QVariant;
-
-namespace ConfigEditor
-{
-using namespace std::placeholders;
-
-void setGtk2ConfigValue(const QString &paramName, const QVariant &paramValue);
-
-void setGtkConfigValueGSettings(const QString &paramName, const QVariant 
&paramValue, const QString &category = 
QStringLiteral("org.gnome.desktop.interface"));
-void setGtkConfigValueGSettingsAsEnum(const QString &paramName, int 
paramValue, const QString &category = 
QStringLiteral("org.gnome.desktop.interface"));
-void setGtk3ConfigValueXSettingsd(const QString &paramName, const QVariant 
&paramValue);
-
-void setGtkConfigValueSettingsIni(const QString &versionString, const QString 
&paramName, const QVariant &paramValue);
-static auto setGtk4ConfigValueSettingsIni = 
std::bind(setGtkConfigValueSettingsIni, QStringLiteral("gtk-4.0"), _1, _2);
-static auto setGtk3ConfigValueSettingsIni = 
std::bind(setGtkConfigValueSettingsIni, QStringLiteral("gtk-3.0"), _1, _2);
-
-void unsetGtkConfigValueSettingsIni(const QString &versionString, const 
QString &paramName);
-static auto unsetGtk4ConfigValueSettingsIni = 
std::bind(unsetGtkConfigValueSettingsIni, QStringLiteral("gtk-4.0"), _1);
-
-QString gtkConfigValueSettingsIni(const QString &versionString, const QString 
&paramName);
-static auto gtk4ConfigValueSettingsIni = std::bind(gtkConfigValueSettingsIni, 
QStringLiteral("gtk-4.0"), _1);
-static auto gtk3ConfigValueSettingsIni = std::bind(gtkConfigValueSettingsIni, 
QStringLiteral("gtk-3.0"), _1);
-
-static auto gtkCssVersions = {QStringLiteral("/gtk-3.0"), 
QStringLiteral("/gtk-4.0")};
-
-void setCustomClientSideDecorations(const QStringList 
&windowDecorationsButtonsImages);
-void disableCustomClientSideDecorations();
-void setGtk3Colors(const QMap<QString, QColor> &colorsDefinitions);
-
-void removeLegacyGtk2Strings();
-
-void saveWindowDecorationsToAssets(const QStringList 
&windowDecorationsButtonsImages);
-void addWindowDecorationsCssFile();
-
-void addGtkModule(const QString &moduleName);
-
-void addImportStatementsToGtkCssUserFile();
-void removeWindowDecorationsCSS();
-void modifyColorsCssFile(const QMap<QString, QColor> &colorsDefinitions);
-
-void replaceValueInGtkrcContents(QString &gtkrcContents, const QString 
&paramName, const QVariant &paramValue);
-void replaceValueInXSettingsdContents(QString &xSettingsdContents, const 
QString &paramName, const QVariant &paramValue);
-
-QString readFileContents(QFile &gtkrc);
-
-void reloadXSettingsd();
-
-pid_t pidOfXSettingsd();
-};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.26.5/kded/configvalueprovider.cpp 
new/kde-gtk-config-5.27.0/kded/configvalueprovider.cpp
--- old/kde-gtk-config-5.26.5/kded/configvalueprovider.cpp      2023-01-03 
19:00:55.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/configvalueprovider.cpp      2023-02-09 
12:59:08.000000000 +0100
@@ -22,6 +22,8 @@
 #include "configvalueprovider.h"
 #include "decorationpainter.h"
 
+constexpr int MAX_GDK_SCALE = 5;
+
 ConfigValueProvider::ConfigValueProvider()
     : kdeglobalsConfig(KSharedConfig::openConfig())
     , inputConfig(KSharedConfig::openConfig(QStringLiteral("kcminputrc")))
@@ -456,6 +458,29 @@
     return result;
 }
 
+double ConfigValueProvider::globalScaleFactor() const
+{
+    KConfigGroup configGroup = 
kdeglobalsConfig->group(QStringLiteral("KScreen"));
+    QString entry = configGroup.readEntry(QStringLiteral("ScaleFactor"), "1");
+    bool conversionOk = false;
+    double scaleFactor = entry.toDouble(&conversionOk);
+
+    if (conversionOk && scaleFactor > 1.0 && scaleFactor < (MAX_GDK_SCALE + 
0.1))
+        return scaleFactor;
+
+    return 1.0;
+}
+
+int ConfigValueProvider::globalScaleFactorAsPercent() const
+{
+    return int(globalScaleFactor() * 100.0);
+}
+
+int ConfigValueProvider::globalScaleFactorFloor() const
+{
+    return globalScaleFactorAsPercent() / 100;
+}
+
 QString ConfigValueProvider::windowDecorationButtonsOrderInGtkNotation(const 
QString &kdeConfigValue) const
 {
     QString gtkNotation;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.26.5/kded/configvalueprovider.h 
new/kde-gtk-config-5.27.0/kded/configvalueprovider.h
--- old/kde-gtk-config-5.26.5/kded/configvalueprovider.h        2023-01-03 
19:00:55.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/configvalueprovider.h        2023-02-09 
12:59:08.000000000 +0100
@@ -31,6 +31,10 @@
     QStringList windowDecorationsButtonsImages() const;
     bool enableAnimations() const;
     QMap<QString, QColor> colors() const;
+    /* For X11, which doesn't support mixed-DPI setups */
+    double globalScaleFactor() const;
+    int globalScaleFactorAsPercent() const;
+    int globalScaleFactorFloor() const;
 
 private:
     QString fontStyleHelper(const QFont &font) const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.26.5/kded/gtkconfig.cpp 
new/kde-gtk-config-5.27.0/kded/gtkconfig.cpp
--- old/kde-gtk-config-5.26.5/kded/gtkconfig.cpp        2023-01-03 
19:00:55.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/gtkconfig.cpp        2023-02-09 
12:59:08.000000000 +0100
@@ -5,15 +5,22 @@
  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR 
LicenseRef-KDE-Accepted-GPL
  */
 
+#include "gtkconfig.h"
+
+#include <KColorScheme>
+#include <KPluginFactory>
+#include <KWindowSystem>
+
 #include <QDBusConnection>
 #include <QDBusMessage>
 #include <QFont>
 #include <QGuiApplication>
 
-#include <KColorScheme>
-#include <KPluginFactory>
-
-#include "gtkconfig.h"
+#include "config_editor/custom_css.h"
+#include "config_editor/gsettings.h"
+#include "config_editor/gtk2.h"
+#include "config_editor/settings_ini.h"
+#include "config_editor/xsettings.h"
 
 K_PLUGIN_CLASS_WITH_JSON(GtkConfig, "gtkconfig.json")
 
@@ -35,7 +42,7 @@
     connect(kcminputConfigWatcher.data(), &KConfigWatcher::configChanged, 
this, &GtkConfig::onKCMInputSettingsChange);
     connect(breezeConfigWatcher.data(), &KConfigWatcher::configChanged, this, 
&GtkConfig::onBreezeSettingsChange);
 
-    ConfigEditor::removeLegacyGtk2Strings();
+    Gtk2ConfigEditor::removeLegacyStrings();
     applyAllSettings();
 }
 
@@ -48,11 +55,10 @@
 
 void GtkConfig::setGtkTheme(const QString &themeName) const
 {
-    ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-theme-name"), 
themeName);
-    ConfigEditor::setGtkConfigValueGSettings(QStringLiteral("gtk-theme"), 
themeName);
-    
ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-theme-name"), 
themeName);
-    
ConfigEditor::setGtk4ConfigValueSettingsIni(QStringLiteral("gtk-theme-name"), 
themeName);
-    
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Net/ThemeName"), 
themeName);
+    Gtk2ConfigEditor::setValue(QStringLiteral("gtk-theme-name"), themeName);
+    GSettingsEditor::setValue(QStringLiteral("gtk-theme"), themeName);
+    SettingsIniEditor::setValue(QStringLiteral("gtk-theme-name"), themeName);
+    XSettingsEditor::setValue(QStringLiteral("Net/ThemeName"), themeName);
 
     // Window decorations are part of the theme, in case of Breeze we inject 
custom ones from KWin
     setWindowDecorationsAppearance();
@@ -60,7 +66,7 @@
 
 QString GtkConfig::gtkTheme() const
 {
-    return 
ConfigEditor::gtk3ConfigValueSettingsIni(QStringLiteral("gtk-theme-name"));
+    return SettingsIniEditor::value(QStringLiteral("gtk-theme-name"));
 }
 
 void GtkConfig::showGtkThemePreview(const QString &themeName) const
@@ -71,120 +77,147 @@
 void GtkConfig::setFont() const
 {
     const QString configFontName = configValueProvider->fontName();
-    ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-font-name"), 
configFontName);
-    ConfigEditor::setGtkConfigValueGSettings(QStringLiteral("font-name"), 
configFontName);
-    
ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-font-name"), 
configFontName);
-    
ConfigEditor::setGtk4ConfigValueSettingsIni(QStringLiteral("gtk-font-name"), 
configFontName);
-    ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/FontName"), 
configFontName);
+    Gtk2ConfigEditor::setValue(QStringLiteral("gtk-font-name"), 
configFontName);
+    GSettingsEditor::setValue(QStringLiteral("font-name"), configFontName);
+    SettingsIniEditor::setValue(QStringLiteral("gtk-font-name"), 
configFontName);
+    XSettingsEditor::setValue(QStringLiteral("Gtk/FontName"), configFontName);
 }
 
 void GtkConfig::setIconTheme() const
 {
     const QString iconThemeName = configValueProvider->iconThemeName();
-    ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-icon-theme-name"), 
iconThemeName);
-    ConfigEditor::setGtkConfigValueGSettings(QStringLiteral("icon-theme"), 
iconThemeName);
-    
ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-icon-theme-name"),
 iconThemeName);
-    
ConfigEditor::setGtk4ConfigValueSettingsIni(QStringLiteral("gtk-icon-theme-name"),
 iconThemeName);
-    
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Net/IconThemeName"), 
iconThemeName);
+    Gtk2ConfigEditor::setValue(QStringLiteral("gtk-icon-theme-name"), 
iconThemeName);
+    GSettingsEditor::setValue(QStringLiteral("icon-theme"), iconThemeName);
+    SettingsIniEditor::setValue(QStringLiteral("gtk-icon-theme-name"), 
iconThemeName);
+    XSettingsEditor::setValue(QStringLiteral("Net/IconThemeName"), 
iconThemeName);
 }
 
 void GtkConfig::setCursorTheme() const
 {
     const QString cursorThemeName = configValueProvider->cursorThemeName();
-    ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-cursor-theme-name"), 
cursorThemeName);
-    ConfigEditor::setGtkConfigValueGSettings(QStringLiteral("cursor-theme"), 
cursorThemeName);
-    
ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-cursor-theme-name"),
 cursorThemeName);
-    
ConfigEditor::setGtk4ConfigValueSettingsIni(QStringLiteral("gtk-cursor-theme-name"),
 cursorThemeName);
-    
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/CursorThemeName"),
 cursorThemeName);
+    Gtk2ConfigEditor::setValue(QStringLiteral("gtk-cursor-theme-name"), 
cursorThemeName);
+    GSettingsEditor::setValue(QStringLiteral("cursor-theme"), cursorThemeName);
+    SettingsIniEditor::setValue(QStringLiteral("gtk-cursor-theme-name"), 
cursorThemeName);
+    XSettingsEditor::setValue(QStringLiteral("Gtk/CursorThemeName"), 
cursorThemeName);
 }
 
 void GtkConfig::setCursorSize() const
 {
     const int cursorSize = configValueProvider->cursorSize();
-    ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-cursor-theme-size"), 
cursorSize);
-    ConfigEditor::setGtkConfigValueGSettings(QStringLiteral("cursor-size"), 
cursorSize);
-    
ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-cursor-theme-size"),
 cursorSize);
-    
ConfigEditor::setGtk4ConfigValueSettingsIni(QStringLiteral("gtk-cursor-theme-size"),
 cursorSize);
-    
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/CursorThemeSize"),
 cursorSize);
+    Gtk2ConfigEditor::setValue(QStringLiteral("gtk-cursor-theme-size"), 
cursorSize);
+    GSettingsEditor::setValue(QStringLiteral("cursor-size"), cursorSize);
+    SettingsIniEditor::setValue(QStringLiteral("gtk-cursor-theme-size"), 
cursorSize);
+    XSettingsEditor::setValue(QStringLiteral("Gtk/CursorThemeSize"), 
cursorSize);
 }
 
 void GtkConfig::setIconsOnButtons() const
 {
     const bool iconsOnButtonsConfigValue = 
configValueProvider->iconsOnButtons();
-    ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-button-images"), 
iconsOnButtonsConfigValue);
-    
ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-button-images"),
 iconsOnButtonsConfigValue);
-    // Deprecated in Gtk4
-    
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/ButtonImages"), 
iconsOnButtonsConfigValue);
+    Gtk2ConfigEditor::setValue(QStringLiteral("gtk-button-images"), 
iconsOnButtonsConfigValue);
+    // Deprecated in GTK 4
+    SettingsIniEditor::setValue(QStringLiteral("gtk-button-images"), 
iconsOnButtonsConfigValue, 3);
+    XSettingsEditor::setValue(QStringLiteral("Gtk/ButtonImages"), 
iconsOnButtonsConfigValue);
 }
 
 void GtkConfig::setIconsInMenus() const
 {
     const bool iconsInMenusConfigValue = configValueProvider->iconsInMenus();
-    ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-menu-images"), 
iconsInMenusConfigValue);
-    
ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-menu-images"), 
iconsInMenusConfigValue);
-    // Deprecated in Gtk4
-    
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/MenuImages"), 
iconsInMenusConfigValue);
+    Gtk2ConfigEditor::setValue(QStringLiteral("gtk-menu-images"), 
iconsInMenusConfigValue);
+    // Deprecated in GTK 4
+    SettingsIniEditor::setValue(QStringLiteral("gtk-menu-images"), 
iconsInMenusConfigValue, 3);
+    XSettingsEditor::setValue(QStringLiteral("Gtk/MenuImages"), 
iconsInMenusConfigValue);
 }
 
 void GtkConfig::setToolbarStyle() const
 {
     const int toolbarStyle = configValueProvider->toolbarStyle();
-    ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-toolbar-style"), 
toolbarStyle);
-    
ConfigEditor::setGtkConfigValueGSettingsAsEnum(QStringLiteral("toolbar-style"), 
toolbarStyle);
-    
ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-toolbar-style"),
 toolbarStyle);
-    // Deprecated in Gtk4
-    
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/ToolbarStyle"), 
toolbarStyle);
+    Gtk2ConfigEditor::setValue(QStringLiteral("gtk-toolbar-style"), 
toolbarStyle);
+    GSettingsEditor::setValueAsEnum(QStringLiteral("toolbar-style"), 
toolbarStyle);
+    // Deprecated in GTK 4
+    SettingsIniEditor::setValue(QStringLiteral("gtk-toolbar-style"), 
toolbarStyle, 3);
+    XSettingsEditor::setValue(QStringLiteral("Gtk/ToolbarStyle"), 
toolbarStyle);
 }
 
 void GtkConfig::setScrollbarBehavior() const
 {
     const bool scrollbarBehavior = configValueProvider->scrollbarBehavior();
-    
ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-primary-button-warps-slider"),
 scrollbarBehavior);
-    
ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-primary-button-warps-slider"),
 scrollbarBehavior);
-    
ConfigEditor::setGtk4ConfigValueSettingsIni(QStringLiteral("gtk-primary-button-warps-slider"),
 scrollbarBehavior);
-    
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/PrimaryButtonWarpsSlider"),
 scrollbarBehavior);
+    
Gtk2ConfigEditor::setValue(QStringLiteral("gtk-primary-button-warps-slider"), 
scrollbarBehavior);
+    
SettingsIniEditor::setValue(QStringLiteral("gtk-primary-button-warps-slider"), 
scrollbarBehavior);
+    XSettingsEditor::setValue(QStringLiteral("Gtk/PrimaryButtonWarpsSlider"), 
scrollbarBehavior);
 }
 
 void GtkConfig::setDarkThemePreference() const
 {
     const bool preferDarkTheme = configValueProvider->preferDarkTheme();
-    
ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-application-prefer-dark-theme"),
 preferDarkTheme);
-    
ConfigEditor::setGtk4ConfigValueSettingsIni(QStringLiteral("gtk-application-prefer-dark-theme"),
 preferDarkTheme);
+    
SettingsIniEditor::setValue(QStringLiteral("gtk-application-prefer-dark-theme"),
 preferDarkTheme);
 }
 
 void GtkConfig::setWindowDecorationsAppearance() const
 {
     if (gtkTheme() == QStringLiteral("Breeze")) { // Only Breeze GTK supports 
custom decoration buttons
         const auto windowDecorationsButtonsImages = 
configValueProvider->windowDecorationsButtonsImages();
-        
ConfigEditor::setCustomClientSideDecorations(windowDecorationsButtonsImages);
+        
CustomCssEditor::setCustomClientSideDecorations(windowDecorationsButtonsImages);
     } else {
-        ConfigEditor::disableCustomClientSideDecorations();
+        CustomCssEditor::disableCustomClientSideDecorations();
     }
 }
 
 void GtkConfig::setWindowDecorationsButtonsOrder() const
 {
     const QString windowDecorationsButtonOrder = 
configValueProvider->windowDecorationsButtonsOrder();
-    ConfigEditor::setGtkConfigValueGSettings(QStringLiteral("button-layout"), 
windowDecorationsButtonOrder, 
QStringLiteral("org.gnome.desktop.wm.preferences"));
-    
ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-decoration-layout"),
 windowDecorationsButtonOrder);
-    
ConfigEditor::setGtk4ConfigValueSettingsIni(QStringLiteral("gtk-decoration-layout"),
 windowDecorationsButtonOrder);
-    
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/DecorationLayout"),
 windowDecorationsButtonOrder);
+    GSettingsEditor::setValue(QStringLiteral("button-layout"), 
windowDecorationsButtonOrder, 
QStringLiteral("org.gnome.desktop.wm.preferences"));
+    SettingsIniEditor::setValue(QStringLiteral("gtk-decoration-layout"), 
windowDecorationsButtonOrder);
+    XSettingsEditor::setValue(QStringLiteral("Gtk/DecorationLayout"), 
windowDecorationsButtonOrder);
 }
 
 void GtkConfig::setEnableAnimations() const
 {
     const bool enableAnimations = configValueProvider->enableAnimations();
-    ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-enable-animations"), 
enableAnimations);
-    
ConfigEditor::setGtkConfigValueGSettings(QStringLiteral("enable-animations"), 
enableAnimations);
-    
ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-enable-animations"),
 enableAnimations);
-    
ConfigEditor::setGtk4ConfigValueSettingsIni(QStringLiteral("gtk-enable-animations"),
 enableAnimations);
-    
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/EnableAnimations"),
 enableAnimations);
+    Gtk2ConfigEditor::setValue(QStringLiteral("gtk-enable-animations"), 
enableAnimations);
+    GSettingsEditor::setValue(QStringLiteral("enable-animations"), 
enableAnimations);
+    SettingsIniEditor::setValue(QStringLiteral("gtk-enable-animations"), 
enableAnimations);
+    XSettingsEditor::setValue(QStringLiteral("Gtk/EnableAnimations"), 
enableAnimations);
+}
+
+void GtkConfig::setGlobalScale() const
+{
+    // The global scale is relevant only for GTK3 and GTK4 (GTK2 has no 
support for DPI
+    // scaling) and on X11 sessions, because on Wayland scales are 
communicated by KWin
+    // directly to every surface
+
+    if (KWindowSystem::isPlatformX11()) {
+        const int globalScale = configValueProvider->globalScaleFactorFloor();
+        XSettingsEditor::setValue(QStringLiteral("Gdk/WindowScalingFactor"), 
globalScale);
+    } else {
+        XSettingsEditor::setValue(QStringLiteral("Gdk/WindowScalingFactor"), 
1);
+    }
+}
+
+void GtkConfig::setTextScale() const
+{
+    constexpr int baseTextDpi = 96 * 1024;
+
+    // The setting in question is "gtk-xft-dpi", however XSettings may provide
+    // also "Gdk/UnscaledDPI", which has precedence over the "Xft/DPI" XSetting
+    // (only for GTK3 and GTK4, as GTK2 has no specific knowledge of DPI 
scaling)
+
+    if (KWindowSystem::isPlatformX11()) {
+        const int globalScalePercent = 
configValueProvider->globalScaleFactorAsPercent();
+        const int textScalePercent = 100 + (globalScalePercent % 100);
+        const double textScaleFactor = textScalePercent / 100.0;
+        const int textDpi = textScaleFactor * baseTextDpi;
+        SettingsIniEditor::setValue(QStringLiteral("gtk-xft-dpi"), textDpi);
+        XSettingsEditor::setValue(QStringLiteral("Gdk/UnscaledDPI"), textDpi);
+    } else {
+        SettingsIniEditor::setValue(QStringLiteral("gtk-xft-dpi"), 
baseTextDpi);
+        XSettingsEditor::setValue(QStringLiteral("Gdk/UnscaledDPI"), 
baseTextDpi);
+    }
 }
 
 void GtkConfig::setColors() const
 {
     const QMap<QString, QColor> colors = configValueProvider->colors();
-    ConfigEditor::setGtk3Colors(colors);
+    CustomCssEditor::setColors(colors);
 }
 
 void GtkConfig::applyAllSettings() const
@@ -201,6 +234,8 @@
     setWindowDecorationsAppearance();
     setWindowDecorationsButtonsOrder();
     setEnableAnimations();
+    setGlobalScale();
+    setTextScale();
     setColors();
 }
 
@@ -232,6 +267,11 @@
             setDarkThemePreference();
             setWindowDecorationsAppearance(); // Decorations' color can depend 
on the current color scheme
         }
+    } else if (group.name() == QStringLiteral("KScreen")) {
+        if (names.contains(QByteArrayLiteral("ScaleFactor"))) {
+            setGlobalScale();
+            setTextScale();
+        }
     } else if (group.name() == QStringLiteral("Toolbar style")) {
         if (names.contains(QByteArrayLiteral("ToolButtonStyle"))) {
             setToolbarStyle();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.26.5/kded/gtkconfig.h 
new/kde-gtk-config-5.27.0/kded/gtkconfig.h
--- old/kde-gtk-config-5.26.5/kded/gtkconfig.h  2023-01-03 19:00:55.000000000 
+0100
+++ new/kde-gtk-config-5.27.0/kded/gtkconfig.h  2023-02-09 12:59:08.000000000 
+0100
@@ -10,7 +10,6 @@
 #include <KConfigWatcher>
 #include <KDEDModule>
 
-#include "configeditor.h"
 #include "configvalueprovider.h"
 #include "themepreviewer.h"
 
@@ -35,6 +34,8 @@
     void setWindowDecorationsAppearance() const;
     void setWindowDecorationsButtonsOrder() const;
     void setEnableAnimations() const;
+    void setGlobalScale() const;
+    void setTextScale() const;
     void setColors() const;
 
     void applyAllSettings() const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.26.5/kded/gtkconfig.json 
new/kde-gtk-config-5.27.0/kded/gtkconfig.json
--- old/kde-gtk-config-5.26.5/kded/gtkconfig.json       2023-01-03 
19:00:55.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/gtkconfig.json       2023-02-09 
12:59:08.000000000 +0100
@@ -2,7 +2,6 @@
     "KPlugin": {
         "Description": "Automatically applies settings to GNOME/GTK 
applications",
         "Description[ar]": "تطبق الإعدادات على تطبيقات 
غنوم/جي تي كي آليا",
-        "Description[ast]": "Aplica automáticamente los axustes 
n'aplicaciones de GNOME/GTK",
         "Description[az]": "Ayarları avtomatik GNOME/GTK tətbiqlərinə 
tətbiq etmək",
         "Description[bg]": "Автоматично прилага 
настройките за GNOME/GTK приложения",
         "Description[ca@valencia]": "Aplica automàticament la configuració a 
les aplicacions GNOME/GTK",
@@ -44,7 +43,6 @@
         "Icon": "gtkconfig",
         "Name": "GNOME/GTK Settings Synchronization Service",
         "Name[ar]": "خدمة مزامنة إعدادات غنوم/جي تي 
كي",
-        "Name[ast]": "Serviciu de la sincronización d'axustes de GNOME/GTK",
         "Name[az]": "GNOME/GTK Ayarları Sinxronizasiya Xidməti",
         "Name[bg]": "Настройки на услугата за GNOME/GTK 
синхронизиране",
         "Name[ca@valencia]": "Servei de sincronització de la configuració de 
GNOME/GTK",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kde-gtk-config-5.26.5/kded/kwin_bridge/dummydecoratedclient.cpp 
new/kde-gtk-config-5.27.0/kded/kwin_bridge/dummydecoratedclient.cpp
--- old/kde-gtk-config-5.26.5/kded/kwin_bridge/dummydecoratedclient.cpp 
2023-01-03 19:00:55.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/kwin_bridge/dummydecoratedclient.cpp 
2023-02-09 12:59:08.000000000 +0100
@@ -151,6 +151,11 @@
     return {};
 }
 
+QString DummyDecoratedClient::windowClass() const
+{
+    return {};
+}
+
 void DummyDecoratedClient::requestShowToolTip(const QString &text)
 {
     Q_UNUSED(text)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kde-gtk-config-5.26.5/kded/kwin_bridge/dummydecoratedclient.h 
new/kde-gtk-config-5.27.0/kded/kwin_bridge/dummydecoratedclient.h
--- old/kde-gtk-config-5.26.5/kded/kwin_bridge/dummydecoratedclient.h   
2023-01-03 19:00:55.000000000 +0100
+++ new/kde-gtk-config-5.27.0/kded/kwin_bridge/dummydecoratedclient.h   
2023-02-09 12:59:08.000000000 +0100
@@ -50,6 +50,7 @@
     QPalette palette() const override;
     QColor color(ColorGroup group, ColorRole role) const override;
     Qt::Edges adjacentScreenEdges() const override;
+    QString windowClass() const override;
 
     void requestShowToolTip(const QString &text) override;
 

Reply via email to