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
wilder-5.24
David Edmundson 5 years ago
parent 0043576005
commit 9b9b6e5d9b
  1. 5
      shell/main.cpp
  2. 3
      shell/shellcorona.cpp
  3. 1
      shell/shellcorona.h

@ -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)

Loading…
Cancel
Save