Commit 2a67a010 authored by David Edmundson's avatar David Edmundson
Browse files

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


(cherry picked from commit 9b9b6e5d)
parent 9d2051b0
......@@ -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();
......
......@@ -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);
});
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment