Hello community, here is the log from the commit of package kded for openSUSE:Factory checked in at 2018-03-30 12:01:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kded (Old) and /work/SRC/openSUSE:Factory/.kded.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kded" Fri Mar 30 12:01:05 2018 rev:52 rq:591865 version:5.44.0 Changes: -------- --- /work/SRC/openSUSE:Factory/kded/kded.changes 2018-03-20 21:45:14.210353775 +0100 +++ /work/SRC/openSUSE:Factory/.kded.new/kded.changes 2018-03-30 12:01:08.227370856 +0200 @@ -1,0 +2,6 @@ +Wed Mar 28 08:28:45 UTC 2018 - [email protected] + +- Add patch to support Wayland sessions without QT_QPA_PLATFORM: + * 0001-Add-platform-detection-and-adjustment-to-kded.patch + +------------------------------------------------------------------- New: ---- 0001-Add-platform-detection-and-adjustment-to-kded.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kded.spec ++++++ --- /var/tmp/diff_new_pack.0ifKNz/_old 2018-03-30 12:01:09.311331659 +0200 +++ /var/tmp/diff_new_pack.0ifKNz/_new 2018-03-30 12:01:09.311331659 +0200 @@ -52,6 +52,8 @@ Group: System/GUI/KDE Url: http://www.kde.org Source: http://download.kde.org/stable/frameworks/%{_tar_path}/%{name}-%{version}.tar.xz +# PATCH-FIX-UPSTREAM +Patch1: 0001-Add-platform-detection-and-adjustment-to-kded.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -72,6 +74,7 @@ %lang_package %prep %setup -q +%autopatch -p1 %build %cmake_kf5 -d build ++++++ 0001-Add-platform-detection-and-adjustment-to-kded.patch ++++++ >From e213b408ac85f54d01eab82f71bc4210a92a28e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= <[email protected]> Date: Wed, 28 Mar 2018 10:28:02 +0200 Subject: [PATCH] Add platform detection and adjustment to kded Summary: Current Plasma/master branch does no longer set the QT_QPA_PLATFORM env variable on Wayland. As kded is a process tightly connected to the workspace it also needs to pick wayland QPA in a Wayland session. This change brings in the adjustment from plasma-workspace and ensures that kded works correctly on any Wayland desktop environment, being it Plasma, GNOME or Weston. Test Plan: Restarted session, kscreen got layout correctly Reviewers: #frameworks, #plasma, apol, romangg Reviewed By: #plasma, romangg Tags: #frameworks Differential Revision: https://phabricator.kde.org/D11583 --- src/kded.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/kded.cpp b/src/kded.cpp index b1f02ea..182555e 100644 --- a/src/kded.cpp +++ b/src/kded.cpp @@ -689,6 +689,33 @@ static void setupAppInfo(QApplication *app) app->setApplicationVersion(QStringLiteral(KDED_VERSION_STRING)); } +static bool detectPlatform(int argc, char **argv) +{ + if (qEnvironmentVariableIsSet("QT_QPA_PLATFORM")) { + return false; + } + for (int i = 0; i < argc; i++) { + if (qstrcmp(argv[i], "-platform") == 0 || + qstrcmp(argv[i], "--platform") == 0 || + QByteArray(argv[i]).startsWith("-platform=") || + QByteArray(argv[i]).startsWith("--platform=")) { + return false; + } + } + const QByteArray sessionType = qgetenv("XDG_SESSION_TYPE"); + if (sessionType.isEmpty()) { + return false; + } + if (qstrcmp(sessionType, "wayland") == 0) { + qputenv("QT_QPA_PLATFORM", "wayland"); + return true; + } else if (qstrcmp(sessionType, "x11") == 0) { + qputenv("QT_QPA_PLATFORM", "xcb"); + return true; + } + return false; +} + extern "C" Q_DECL_EXPORT int kdemain(int argc, char *argv[]) { #ifdef Q_OS_OSX @@ -710,11 +737,16 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char *argv[]) // WABA: Make sure not to enable session management. qunsetenv("SESSION_MANAGER"); + const bool unsetQpa = detectPlatform(argc, argv); + // In older versions, QApplication creation was postponed until after // testing for --check, in which case, only a QCoreApplication was created. // Since that option is no longer used at startup, we removed that speed // optimization for code clarity and easier support of standard parameters. QApplication app(argc, argv); + if (unsetQpa) { + qunsetenv("QT_QPA_PLATFORM"); + } setupAppInfo(&app); app.setQuitOnLastWindowClosed(false); -- 2.16.2
