From 2a6104db558b22c2a3de9db8b62349a27d0bc3301a7b7d57e6e3ca51ff056c84 Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Wed, 28 Mar 2018 08:21:01 +0000 Subject: [PATCH] - Add patches to support wayland sessions without QT_QPA_PLUGIN: * 0001-Call-KLocalizedString-setApplicationDomain-after-Q-A.patch * 0002-Use-platform-detection-from-KWorkSpace-in-KCMShell.patch * 0003-Fix-build-in-kcmshell5-accidentially-landed-the-wron.patch OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kde-cli-tools5?expand=0&rev=187 --- ...tring-setApplicationDomain-after-Q-A.patch | 29 +++++++ ...etection-from-KWorkSpace-in-KCMShell.patch | 79 +++++++++++++++++++ ...shell5-accidentially-landed-the-wron.patch | 27 +++++++ kde-cli-tools5.changes | 8 ++ kde-cli-tools5.spec | 6 +- 5 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 0001-Call-KLocalizedString-setApplicationDomain-after-Q-A.patch create mode 100644 0002-Use-platform-detection-from-KWorkSpace-in-KCMShell.patch create mode 100644 0003-Fix-build-in-kcmshell5-accidentially-landed-the-wron.patch diff --git a/0001-Call-KLocalizedString-setApplicationDomain-after-Q-A.patch b/0001-Call-KLocalizedString-setApplicationDomain-after-Q-A.patch new file mode 100644 index 0000000..57d9922 --- /dev/null +++ b/0001-Call-KLocalizedString-setApplicationDomain-after-Q-A.patch @@ -0,0 +1,29 @@ +From e83437e6e5caf39c1c5df4e7ab5600440e43ff28 Mon Sep 17 00:00:00 2001 +From: "Friedrich W. H. Kossebau" +Date: Sat, 10 Feb 2018 14:04:57 +0100 +Subject: [PATCH 1/3] Call KLocalizedString::setApplicationDomain after Q*App + creation + +As now recommended, to ensure all locale settings are done from Qt side +--- + kcmshell/main.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kcmshell/main.cpp b/kcmshell/main.cpp +index dd4ed1c..93dd6f8 100644 +--- a/kcmshell/main.cpp ++++ b/kcmshell/main.cpp +@@ -173,9 +173,9 @@ void KCMShell::appExit(const QString &appId, const QString &oldName, const QStri + + extern "C" Q_DECL_EXPORT int kdemain(int _argc, char *_argv[]) + { ++ KCMShell app(_argc, _argv); + KLocalizedString::setApplicationDomain("kcmshell5"); + +- KCMShell app(_argc, _argv); + app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); + + KAboutData aboutData("kcmshell5", i18n("System Settings Module"), +-- +2.16.2 + diff --git a/0002-Use-platform-detection-from-KWorkSpace-in-KCMShell.patch b/0002-Use-platform-detection-from-KWorkSpace-in-KCMShell.patch new file mode 100644 index 0000000..27e4f70 --- /dev/null +++ b/0002-Use-platform-detection-from-KWorkSpace-in-KCMShell.patch @@ -0,0 +1,79 @@ +From cc5f6765b3e25f411120d2100fb14f0d69de75a1 Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Tue, 27 Mar 2018 09:24:09 +0200 +Subject: [PATCH 2/3] Use platform detection from KWorkSpace in KCMShell + +Summary: In a Wayland session, KCMs need to use the wayland platform plugin. + +Test Plan: kcmshell5 kscreen now works properly. + +Reviewers: #plasma, romangg + +Reviewed By: #plasma, romangg + +Subscribers: romangg, plasma-devel + +Tags: #plasma + +Differential Revision: https://phabricator.kde.org/D11739 +--- + CMakeLists.txt | 2 ++ + kcmshell/CMakeLists.txt | 1 + + kcmshell/main.cpp | 8 ++++++++ + 3 files changed, 11 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 26d5e7e..0c04e8d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -50,6 +50,8 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS + QUIET + ) + ++find_package(LibKWorkspace ${PROJECT_VERSION} REQUIRED) ++ + # Disables automatic conversions from QString (or char *) to QUrl. + add_definitions(-DQT_NO_URL_CAST_FROM_STRING) + +diff --git a/kcmshell/CMakeLists.txt b/kcmshell/CMakeLists.txt +index f787136..7c33290 100644 +--- a/kcmshell/CMakeLists.txt ++++ b/kcmshell/CMakeLists.txt +@@ -11,6 +11,7 @@ target_link_libraries(kdeinit_kcmshell5 + KF5::I18n + KF5::WindowSystem + KF5::Activities ++ PW::KWorkspace + ) + + install(TARGETS kdeinit_kcmshell5 ${INSTALL_TARGETS_DEFAULT_ARGS}) +diff --git a/kcmshell/main.cpp b/kcmshell/main.cpp +index 93dd6f8..d855b96 100644 +--- a/kcmshell/main.cpp ++++ b/kcmshell/main.cpp +@@ -40,6 +40,8 @@ + #include + #include + ++#include ++ + #include + #include + #include +@@ -173,7 +175,13 @@ void KCMShell::appExit(const QString &appId, const QString &oldName, const QStri + + extern "C" Q_DECL_EXPORT int kdemain(int _argc, char *_argv[]) + { ++ const bool qpaVariable = qEnvironmentVariableIsSet("QT_QPA_PLATFORM"); ++ KWorkSpace::detectPlatform(argc, argv); + KCMShell app(_argc, _argv); ++ if (!qpaVariable) { ++ // don't leak the env variable to processes we start ++ qunsetenv("QT_QPA_PLATFORM"); ++ } + KLocalizedString::setApplicationDomain("kcmshell5"); + + app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); +-- +2.16.2 + diff --git a/0003-Fix-build-in-kcmshell5-accidentially-landed-the-wron.patch b/0003-Fix-build-in-kcmshell5-accidentially-landed-the-wron.patch new file mode 100644 index 0000000..eba62f2 --- /dev/null +++ b/0003-Fix-build-in-kcmshell5-accidentially-landed-the-wron.patch @@ -0,0 +1,27 @@ +From 74969bbb1ee83ee90d9d078cb38d4213c92a14ec Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Tue, 27 Mar 2018 21:31:39 +0200 +Subject: [PATCH 3/3] Fix build in kcmshell5, accidentially landed the wrong + revision + +Needs to be _argc, _argv. +--- + kcmshell/main.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kcmshell/main.cpp b/kcmshell/main.cpp +index d855b96..aa2cd05 100644 +--- a/kcmshell/main.cpp ++++ b/kcmshell/main.cpp +@@ -176,7 +176,7 @@ void KCMShell::appExit(const QString &appId, const QString &oldName, const QStri + extern "C" Q_DECL_EXPORT int kdemain(int _argc, char *_argv[]) + { + const bool qpaVariable = qEnvironmentVariableIsSet("QT_QPA_PLATFORM"); +- KWorkSpace::detectPlatform(argc, argv); ++ KWorkSpace::detectPlatform(_argc, _argv); + KCMShell app(_argc, _argv); + if (!qpaVariable) { + // don't leak the env variable to processes we start +-- +2.16.2 + diff --git a/kde-cli-tools5.changes b/kde-cli-tools5.changes index 29035d2..30f4f0e 100644 --- a/kde-cli-tools5.changes +++ b/kde-cli-tools5.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Mar 28 08:20:00 UTC 2018 - fabian@ritter-vogt.de + +- Add patches to support wayland sessions without QT_QPA_PLUGIN: + * 0001-Call-KLocalizedString-setApplicationDomain-after-Q-A.patch + * 0002-Use-platform-detection-from-KWorkSpace-in-KCMShell.patch + * 0003-Fix-build-in-kcmshell5-accidentially-landed-the-wron.patch + ------------------------------------------------------------------- Tue Mar 27 15:40:47 CEST 2018 - fabian@ritter-vogt.de diff --git a/kde-cli-tools5.spec b/kde-cli-tools5.spec index 1d11a58..f2c1699 100644 --- a/kde-cli-tools5.spec +++ b/kde-cli-tools5.spec @@ -27,6 +27,10 @@ Url: http://www.kde.org Source: http://download.kde.org/stable/plasma/%{version}/kde-cli-tools-%{version}.tar.xz # PATCH-FIX-OPENSUSE kdesu-add-some-i18n-love.patch -- boo#852256 Patch0: kdesu-add-some-i18n-love.patch +# PATCH-FIX-UPSTREAM +Patch1: 0001-Call-KLocalizedString-setApplicationDomain-after-Q-A.patch +Patch2: 0002-Use-platform-detection-from-KWorkSpace-in-KCMShell.patch +Patch3: 0003-Fix-build-in-kcmshell5-accidentially-landed-the-wron.patch BuildRequires: extra-cmake-modules >= 1.3.0 BuildRequires: kf5-filesystem BuildRequires: xz @@ -63,7 +67,7 @@ Additional CLI tools for KDE applications and workspaces. %lang_package %prep %setup -q -n kde-cli-tools-%{version} -%patch0 -p1 +%autopatch -p1 %build %cmake_kf5 -d build