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-24 18:06:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kde-gtk-config5 (Old)
 and      /work/SRC/openSUSE:Factory/.kde-gtk-config5.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kde-gtk-config5"

Fri Feb 24 18:06:49 2023 rev:147 rq:1067221 version:5.27.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/kde-gtk-config5/kde-gtk-config5.changes  
2023-02-13 16:41:43.247658753 +0100
+++ 
/work/SRC/openSUSE:Factory/.kde-gtk-config5.new.31432/kde-gtk-config5.changes   
    2023-02-24 18:06:55.472982287 +0100
@@ -1,0 +2,13 @@
+Tue Feb 21 14:09:17 UTC 2023 - Fabian Vogt <[email protected]>
+
+- Update to 5.27.1
+  * New bugfix release
+  * For more details please see:
+  * https://kde.org/announcements/plasma/5/5.27.1
+- Changes since 5.27.0:
+  * xsettings: restrict `pidof` to own processes
+  * Add support for XWayland client scaling (kde#465733)
+  * Remove unnecessary `canConvert` check
+  * Unset `Gdk/UnscaledDPI` and `Gdk/WindowScalingFactor` on Wayland 
(kde#465733)
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ kde-gtk-config5.spec ++++++
--- /var/tmp/diff_new_pack.VjsQ2n/_old  2023-02-24 18:06:56.136986245 +0100
+++ /var/tmp/diff_new_pack.VjsQ2n/_new  2023-02-24 18:06:56.144986292 +0100
@@ -18,15 +18,15 @@
 
 %bcond_without released
 Name:           kde-gtk-config5
-Version:        5.27.0
+Version:        5.27.1
 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:         kde-gtk-config-%{version}.tar.xz
+Source:         
https://download.kde.org/stable/plasma/%{version}/kde-gtk-config-%{version}.tar.xz
 %if %{with released}
-Source1:        kde-gtk-config-%{version}.tar.xz.sig
+Source1:        
https://download.kde.org/stable/plasma/%{version}/kde-gtk-config-%{version}.tar.xz.sig
 Source2:        plasma.keyring
 %endif
 BuildRequires:  extra-cmake-modules >= 5.98.0

++++++ kde-gtk-config-5.27.0.tar.xz -> kde-gtk-config-5.27.1.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.27.0/CMakeLists.txt 
new/kde-gtk-config-5.27.1/CMakeLists.txt
--- old/kde-gtk-config-5.27.0/CMakeLists.txt    2023-02-09 12:59:08.000000000 
+0100
+++ new/kde-gtk-config-5.27.1/CMakeLists.txt    2023-02-21 12:32:29.000000000 
+0100
@@ -1,5 +1,5 @@
 project(kde-gtk-config)
-set(PROJECT_VERSION "5.27.0")
+set(PROJECT_VERSION "5.27.1")
 cmake_minimum_required(VERSION 3.16)
 
 set(QT_MIN_VERSION "5.15.2")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kde-gtk-config-5.27.0/kded/config_editor/xsettings.cpp 
new/kde-gtk-config-5.27.1/kded/config_editor/xsettings.cpp
--- old/kde-gtk-config-5.27.0/kded/config_editor/xsettings.cpp  2023-02-09 
12:59:08.000000000 +0100
+++ new/kde-gtk-config-5.27.1/kded/config_editor/xsettings.cpp  2023-02-21 
12:32:29.000000000 +0100
@@ -3,6 +3,8 @@
 
 #include "xsettings.h"
 
+#include <unistd.h>
+
 #include <QDir>
 #include <QProcess>
 #include <QRegularExpression>
@@ -39,10 +41,16 @@
 
 pid_t pidOfXSettingsd()
 {
-    QProcess pidof;
-    pidof.start(QStringLiteral("pidof"), QStringList() << QStringLiteral("-s") 
<< QStringLiteral("xsettingsd"));
-    pidof.waitForFinished();
-    QString xsettingsdPid = 
QString(pidof.readAllStandardOutput()).remove('\n');
+    QProcess pgrep;
+    pgrep.start(QStringLiteral("pgrep"),
+                QStringList{
+                    QStringLiteral("-u"),
+                    QString::number(getuid()),
+                    QStringLiteral("-n"), // select most recently started
+                    QStringLiteral("xsettingsd"),
+                });
+    pgrep.waitForFinished();
+    QString xsettingsdPid = 
QString(pgrep.readAllStandardOutput()).remove('\n');
     return xsettingsdPid.toInt();
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.27.0/kded/configvalueprovider.cpp 
new/kde-gtk-config-5.27.1/kded/configvalueprovider.cpp
--- old/kde-gtk-config-5.27.0/kded/configvalueprovider.cpp      2023-02-09 
12:59:08.000000000 +0100
+++ new/kde-gtk-config-5.27.1/kded/configvalueprovider.cpp      2023-02-21 
12:32:29.000000000 +0100
@@ -16,9 +16,12 @@
 #include <KColorUtils>
 #include <KConfig>
 #include <KConfigGroup>
+#include <KWindowSystem>
 
 #include <gtk/gtk.h>
 
+#include <algorithm>
+
 #include "configvalueprovider.h"
 #include "decorationpainter.h"
 
@@ -458,27 +461,19 @@
     return result;
 }
 
-double ConfigValueProvider::globalScaleFactor() const
+double ConfigValueProvider::x11GlobalScaleFactor() 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;
+    double scaleFactor;
 
-    return 1.0;
-}
-
-int ConfigValueProvider::globalScaleFactorAsPercent() const
-{
-    return int(globalScaleFactor() * 100.0);
-}
+    if (KWindowSystem::isPlatformX11()) {
+        KConfigGroup configGroup = 
kdeglobalsConfig->group(QStringLiteral("KScreen"));
+        scaleFactor = configGroup.readEntry(QStringLiteral("ScaleFactor"), 
1.0);
+    } else {
+        KConfigGroup xwaylandGroup = 
kwinConfig->group(QStringLiteral("Xwayland"));
+        scaleFactor = xwaylandGroup.readEntry(QStringLiteral("Scale"), 1.0);
+    }
 
-int ConfigValueProvider::globalScaleFactorFloor() const
-{
-    return globalScaleFactorAsPercent() / 100;
+    return std::clamp(scaleFactor, 1.0, double(MAX_GDK_SCALE));
 }
 
 QString ConfigValueProvider::windowDecorationButtonsOrderInGtkNotation(const 
QString &kdeConfigValue) const
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.27.0/kded/configvalueprovider.h 
new/kde-gtk-config-5.27.1/kded/configvalueprovider.h
--- old/kde-gtk-config-5.27.0/kded/configvalueprovider.h        2023-02-09 
12:59:08.000000000 +0100
+++ new/kde-gtk-config-5.27.1/kded/configvalueprovider.h        2023-02-21 
12:32:29.000000000 +0100
@@ -31,10 +31,14 @@
     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;
+
+    // The global scale factor, as X11 doesn't support mixed-DPI
+    // setups. It's useful both for Plasma/X11 sessions and for
+    // XWayland apps in Plasma/Wayland sessions.
+    //
+    // On Wayland sessions returns 1.0 if XWayland client scaling
+    // is disabled.
+    double x11GlobalScaleFactor() const;
 
 private:
     QString fontStyleHelper(const QFont &font) const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kde-gtk-config-5.27.0/kded/gtkconfig.cpp 
new/kde-gtk-config-5.27.1/kded/gtkconfig.cpp
--- old/kde-gtk-config-5.27.0/kded/gtkconfig.cpp        2023-02-09 
12:59:08.000000000 +0100
+++ new/kde-gtk-config-5.27.1/kded/gtkconfig.cpp        2023-02-21 
12:32:29.000000000 +0100
@@ -9,13 +9,15 @@
 
 #include <KColorScheme>
 #include <KPluginFactory>
-#include <KWindowSystem>
 
 #include <QDBusConnection>
 #include <QDBusMessage>
 #include <QFont>
 #include <QGuiApplication>
 
+#include <algorithm>
+#include <cmath>
+
 #include "config_editor/custom_css.h"
 #include "config_editor/gsettings.h"
 #include "config_editor/gtk2.h"
@@ -181,37 +183,24 @@
 
 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);
-    }
+    const double scaleFactor = configValueProvider->x11GlobalScaleFactor();
+    XSettingsEditor::setValue(QStringLiteral("Gdk/WindowScalingFactor"), 
int(scaleFactor));
 }
 
 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);
-    }
+    const double scaleFactor = configValueProvider->x11GlobalScaleFactor();
+    const double fractionalPart = std::fmod(scaleFactor, 1.0);
+    const double integerPart = std::max(scaleFactor - fractionalPart, 1.0);
+    const int textScaleAbsolute = baseTextDpi * scaleFactor;
+    const int textScaleRelative = baseTextDpi * (1.0 + fractionalPart / 
integerPart);
+
+    SettingsIniEditor::setValue(QStringLiteral("gtk-xft-dpi"), 
textScaleAbsolute);
+    // GTK2
+    XSettingsEditor::setValue(QStringLiteral("Xft/DPI"), textScaleAbsolute);
+    // GTK3 and newer
+    XSettingsEditor::setValue(QStringLiteral("Gdk/UnscaledDPI"), 
textScaleRelative);
 }
 
 void GtkConfig::setColors() const
@@ -289,6 +278,11 @@
         if (names.contains(QByteArrayLiteral("theme"))) {
             setWindowDecorationsAppearance();
         }
+    } else if (group.name() == QStringLiteral("Xwayland")) {
+        if (names.contains(QByteArrayLiteral("Scale"))) {
+            setGlobalScale();
+            setTextScale();
+        }
     }
 }
 

Reply via email to