From 9b9b6e5d9bb7308ea47b99eac4044517a8a80ee4 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Tue, 15 Jun 2021 10:58:31 +0100 Subject: [PATCH] Init ShellCorona after KDBusService ShellCorona is created before KDBusService which registers the name. This causes a problem as we register global shortcuts before plasmashell --replace has kiled the old application, which in turn deregisters everything. We want everything before KDBusService to be as light as possible. Moving ShellCorona construction is not trivial as some argument parsing uses that. BUG: 408310 --- shell/main.cpp | 5 ++++- shell/shellcorona.cpp | 3 +++ shell/shellcorona.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/shell/main.cpp b/shell/main.cpp index 9c9dc3c2d..ff56a6e95 100644 --- a/shell/main.cpp +++ b/shell/main.cpp @@ -115,6 +115,8 @@ int main(int argc, char *argv[]) const QString defaultShell = startupConfGroup.readEntry("ShellPackage", qEnvironmentVariable("PLASMA_DEFAULT_SHELL", "org.kde.plasma.desktop")); bool replace = false; + + ShellCorona *corona; { QCommandLineParser cliOptions; @@ -163,7 +165,7 @@ int main(int argc, char *argv[]) QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement); QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement); - ShellCorona *corona = new ShellCorona(&app); + corona = new ShellCorona(&app); corona->setShell(cliOptions.value(shellPluginOption)); if (!corona->kPackage().isValid()) { qCritical() << "starting invalid corona" << corona->shell(); @@ -246,6 +248,7 @@ int main(int argc, char *argv[]) KDBusService service(KDBusService::Unique | KDBusService::StartupOption(replace ? KDBusService::Replace : 0)); + corona->init(); SoftwareRendererNotifier::notifyIfRelevant(); return app.exec(); diff --git a/shell/shellcorona.cpp b/shell/shellcorona.cpp index 1f7dd5b1b..4c739b7ca 100644 --- a/shell/shellcorona.cpp +++ b/shell/shellcorona.cpp @@ -108,7 +108,10 @@ ShellCorona::ShellCorona(QObject *parent) if (!packageName.isEmpty()) { m_lookAndFeelPackage.setPath(packageName); } +} +void ShellCorona::init() +{ connect(this, &Plasma::Corona::containmentCreated, this, [this](Plasma::Containment *c) { executeSetupPlasmoidScript(c, c); }); diff --git a/shell/shellcorona.h b/shell/shellcorona.h index 0cfc5f9a6..e151157e2 100644 --- a/shell/shellcorona.h +++ b/shell/shellcorona.h @@ -80,6 +80,7 @@ public: ~ShellCorona() override; KPackage::Package lookAndFeelPackage(); + void init(); /** * Where to save global configuration that doesn't have anything to do with the scene (e.g. views)