File 0001-ksmserver-Use-UpdateLaunchEnvJob-to-sync-SESSION_MAN.patch of Package plasma5-workspace

From d24cef54d68fb29994ed610bc70867d6fc811287 Mon Sep 17 00:00:00 2001
From: David Edmundson <kde@davidedmundson.co.uk>
Date: Tue, 1 Sep 2020 13:56:51 +0100
Subject: [PATCH] [ksmserver] Use UpdateLaunchEnvJob to sync SESSION_MANAGER
 env

ksmserver starts in plasma-session. It currently sets the
SESSION_MANAGER env back to just kinit and plasma-session which is then
used for anything else that plasma-session starts.

This is after start-plasma has synced the environment to DBus/systemd.

By using the shared UpdateLaunchEnvJob we can sync all these places.

BUG: 425982
---
 ksmserver/server.cpp | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/ksmserver/server.cpp b/ksmserver/server.cpp
index d7e24a750..29e6b914f 100644
--- a/ksmserver/server.cpp
+++ b/ksmserver/server.cpp
@@ -97,6 +97,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "kscreenlocker_interface.h"
 #include "kwinsession_interface.h"
 
+#include <updatelaunchenvjob.h>
+
 KSMServer* the_server = nullptr;
 
 KSMServer* KSMServer::self()
@@ -661,12 +663,8 @@ KSMServer::KSMServer(InitFlags flags)
         fclose(f);
         setenv( "SESSION_MANAGER", session_manager, true  );
 
-        // Pass env. var to kdeinit.
-        org::kde::KLauncher klauncher( QStringLiteral( "org.kde.klauncher5" ), QStringLiteral( "/KLauncher" ), QDBusConnection::sessionBus());
-        klauncher.setLaunchEnv( QStringLiteral( "SESSION_MANAGER" ), QString::fromLocal8Bit( (const char*) session_manager ) );
-
-        org::kde::Startup startup(QStringLiteral("org.kde.Startup"), QStringLiteral("/Startup"), QDBusConnection::sessionBus());
-        startup.updateLaunchEnv( QStringLiteral( "SESSION_MANAGER" ), QString::fromLocal8Bit( (const char*) session_manager ) );
+        auto updateEnvJob = new UpdateLaunchEnvJob(QStringLiteral("SESSION_MANAGER"), QString::fromLatin1(session_manager));
+        updateEnvJob->start();
 
         free(session_manager);
     }
-- 
2.28.0