From 245480a5a81d363746c2da6ced0582d6a5b96892 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Thu, 9 Apr 2020 10:37:38 -0500 Subject: [PATCH] update patch "Qt applications lose system theme if launched via dbus activation" (#1754395) --- ...space-5.18.4.1-filter-environment-v2.patch | 41 +++++++++++++++++++ ...orkspace-5.18.4.1-filter-environment.patch | 29 ------------- plasma-workspace.spec | 7 +++- 3 files changed, 46 insertions(+), 31 deletions(-) create mode 100644 plasma-workspace-5.18.4.1-filter-environment-v2.patch delete mode 100644 plasma-workspace-5.18.4.1-filter-environment.patch diff --git a/plasma-workspace-5.18.4.1-filter-environment-v2.patch b/plasma-workspace-5.18.4.1-filter-environment-v2.patch new file mode 100644 index 0000000..20dd271 --- /dev/null +++ b/plasma-workspace-5.18.4.1-filter-environment-v2.patch @@ -0,0 +1,41 @@ +diff -r -U3 plasma-workspace-5.18.4.1.orig/startkde/startplasma.cpp plasma-workspace-5.18.4.1/startkde/startplasma.cpp +--- plasma-workspace-5.18.4.1.orig/startkde/startplasma.cpp 2020-03-31 17:33:37.000000000 +0300 ++++ plasma-workspace-5.18.4.1/startkde/startplasma.cpp 2020-04-03 20:43:32.178541309 +0300 +@@ -22,6 +22,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + +@@ -64,8 +66,26 @@ + int runSync(const QString& program, const QStringList &args, const QStringList &env) + { + QProcess p; +- if (!env.isEmpty()) +- p.setEnvironment(QProcess::systemEnvironment() << env); ++ auto pEnv = QProcessEnvironment::systemEnvironment(); ++ if (!env.isEmpty()) { ++ for (const auto &value : env) { ++ int pos = value.indexOf(QStringLiteral("=")); ++ if (pos != -1) { ++ pEnv.insert(value.left(pos), value.mid(pos+1)); ++ } ++ } ++ } ++ if (program.endsWith(QStringLiteral("dbus-update-activation-environment"))) { ++ const QRegularExpression re(QStringLiteral("[^A-Z0-9_]")); ++ for (const auto &key : pEnv.keys()) { ++ const auto match = re.match(key); ++ if (match.hasMatch()) { ++ pEnv.remove(key); ++ qInfo() << "program:" << program << "environment variable removed:" << key; ++ } ++ } ++ } ++ p.setProcessEnvironment(pEnv); + p.setProcessChannelMode(QProcess::ForwardedChannels); + p.start(program, args); + // qDebug() << "started..." << program << args; diff --git a/plasma-workspace-5.18.4.1-filter-environment.patch b/plasma-workspace-5.18.4.1-filter-environment.patch deleted file mode 100644 index 9c10fbe..0000000 --- a/plasma-workspace-5.18.4.1-filter-environment.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff -r -U3 plasma-workspace-5.18.4.1.orig/startkde/startplasma.cpp plasma-workspace-5.18.4.1/startkde/startplasma.cpp ---- plasma-workspace-5.18.4.1.orig/startkde/startplasma.cpp 2020-03-31 17:33:37.000000000 +0300 -+++ plasma-workspace-5.18.4.1/startkde/startplasma.cpp 2020-04-03 12:47:34.812587755 +0300 -@@ -22,6 +22,8 @@ - #include - #include - #include -+#include -+#include - #include - #include - -@@ -265,6 +267,16 @@ - // In that case, the update in startplasma might be too late. - bool syncDBusEnvironment() - { -+ const QRegularExpression re(QString::fromUtf8("[^A-Z0-9_]")); -+ const auto env = QProcessEnvironment::systemEnvironment(); -+ for (const auto &key : env.keys()) { -+ const auto match = re.match(key); -+ if (match.hasMatch()) { -+// qDebug() << "environment variable filtered:" << key; -+ qunsetenv(key.toUtf8().constData()); -+ } -+ } -+ - int exitCode; - // At this point all environment variables are set, let's send it to the DBus session server to update the activation environment - if (!QStandardPaths::findExecutable(QStringLiteral("dbus-update-activation-environment")).isEmpty()) { diff --git a/plasma-workspace.spec b/plasma-workspace.spec index 93a4988..fcdce64 100644 --- a/plasma-workspace.spec +++ b/plasma-workspace.spec @@ -7,7 +7,7 @@ Name: plasma-workspace Summary: Plasma workspace, applications and applets Version: 5.18.4.1 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: https://cgit.kde.org/%{name}.git @@ -45,7 +45,7 @@ Patch101: plasma-workspace-5.3.0-set-fedora-default-look-and-feel.patch # https://github.com/notmart/artwork-lnf-netrunner-core/blob/master/usr/share/plasma/look-and-feel/org.kde.netrunner-core.desktop/contents/defaults Patch105: plasma-workspace-5.7.3-folderview_layout.patch # workaround https://bugzilla.redhat.com/show_bug.cgi?id=1754395 -Patch106: plasma-workspace-5.18.4.1-filter-environment.patch +Patch106: plasma-workspace-5.18.4.1-filter-environment-v2.patch ## upstreamable Patches @@ -609,6 +609,9 @@ desktop-file-validate %{buildroot}%{_kf5_datadir}/applications/org.kde.{klipper, %changelog +* Thu Apr 09 2020 Rex Dieter - 5.18.4.1-2 +- update patch "Qt applications lose system theme if launched via dbus activation" (#1754395) + * Sat Apr 04 2020 Rex Dieter - 5.18.4.1-1 - 5.18.4.1