From e7e49916712d2d8efc65d7da1721eb1d31dc65d6 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 1 Feb 2021 14:50:49 +0000 Subject: [PATCH] Move ksmserver's ksplash notifying to ksmserver Previously the call to ksplash was being emitted by plasma-session. This isn't used in the systemd startup so it was introduced in a somewhat messy script. This script has an issue: If ksplash is disabled the bus name won't be registered. Typically this isn't an issue. However to avoid a race condition ksplash registers itself as being DBus activatable, so that the dbus server holds dispatching the message. This combo means ksmserver our unit is considered as not running until our script times out. This then defers other things in the chain that depend on ksmserver. Moving the call into the relevant piece of code into ksmserver unifies things into a single path and gives us more control. BUG: 432364 --- ksmserver/plasma-ksmserver.service.in | 2 -- ksmserver/server.cpp | 7 +++++++ startkde/plasma-session/startup.cpp | 1 - 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ksmserver/plasma-ksmserver.service.in b/ksmserver/plasma-ksmserver.service.in index 9dcbdfcf0..427be409b 100644 --- a/ksmserver/plasma-ksmserver.service.in +++ b/ksmserver/plasma-ksmserver.service.in @@ -5,8 +5,6 @@ PartOf=graphical-session.target [Service] ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/ksmserver -# This magic minus sign means don't fail if exit code is non-zero... -ExecStartPost=-@QtBinariesDir@/qdbus org.kde.KSplash /KSplash org.kde.KSplash.setStage ksmserver BusName=org.kde.ksmserver Slice=session.slice diff --git a/ksmserver/server.cpp b/ksmserver/server.cpp index 666c6f91b..77fd18d83 100644 --- a/ksmserver/server.cpp +++ b/ksmserver/server.cpp @@ -620,6 +620,13 @@ KSMServer::KSMServer(InitFlags flags) connect(qApp, &QApplication::aboutToQuit, this, &KSMServer::cleanUp); setupXIOErrorHandler(); + + QDBusMessage ksplashProgressMessage = QDBusMessage::createMethodCall(QStringLiteral("org.kde.KSplash"), + QStringLiteral("/KSplash"), + QStringLiteral("org.kde.KSplash"), + QStringLiteral("setStage")); + ksplashProgressMessage.setArguments({QStringLiteral("ksmserver")}); + QDBusConnection::sessionBus().call(ksplashProgressMessage, QDBus::NoBlock); } KSMServer::~KSMServer() diff --git a/startkde/plasma-session/startup.cpp b/startkde/plasma-session/startup.cpp index c3e77d4bf..34d64bce2 100644 --- a/startkde/plasma-session/startup.cpp +++ b/startkde/plasma-session/startup.cpp @@ -220,7 +220,6 @@ Startup::Startup(QObject *parent) QDBusConnection::sessionBus().registerObject(QStringLiteral("/Startup"), QStringLiteral("org.kde.Startup"), this); QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.Startup")); - upAndRunning(QStringLiteral("ksmserver")); const AutoStart autostart; QProcess::execute(QStringLiteral(CMAKE_INSTALL_FULL_LIBEXECDIR_KF5 "/start_kdeinit_wrapper"), QStringList());