Refresh plasmashell when the ShellPackage changes from the LnF

At the moment issues a --replace that will restart the package, will
need to look into why it crashes when tearing up the former shell
package.
wilder-5.24
Aleix Pol 5 years ago committed by Aleix Pol Gonzalez
parent 787a91e9f9
commit 598c643514
  1. 7
      kcms/lookandfeel/kcm.cpp
  2. 2
      kcms/lookandfeel/kcm.h
  3. 1
      shell/dbus/org.kde.PlasmaShell.xml
  4. 6
      shell/main.cpp
  5. 14
      shell/shellcorona.cpp
  6. 4
      shell/shellcorona.h

@ -410,6 +410,12 @@ void KCMLookandFeel::save()
QDBusConnection::sessionBus().send(message);
}
if (m_plasmashellChanged) {
QDBusMessage message =
QDBusMessage::createSignal(QStringLiteral("/PlasmaShell"), QStringLiteral("org.kde.PlasmaShell"), QStringLiteral("refreshCurrentShell"));
QDBusConnection::sessionBus().send(message);
}
// autostart
if (m_resetDefaultLayout) {
// remove all the old package to autostart
@ -759,6 +765,7 @@ void KCMLookandFeel::setWindowPlacement(const QString &value)
void KCMLookandFeel::setShellPackage(const QString &value)
{
writeNewDefaults(QStringLiteral("plasmashellrc"), QStringLiteral("Shell"), QStringLiteral("ShellPackage"), value);
m_plasmashellChanged = true;
}
void KCMLookandFeel::setWindowDecoration(const QString &library, const QString &theme)

@ -138,4 +138,6 @@ private:
bool m_applyShellPackage : 1 = true;
bool m_resetDefaultLayout : 1;
bool m_applyWindowDecoration : 1;
bool m_plasmashellChanged = false;
};

@ -23,5 +23,6 @@
</method>
<method name="activateLauncherMenu">
</method>
<method name="refreshCurrentShell" />
</interface>
</node>

@ -98,10 +98,6 @@ int main(int argc, char *argv[])
app.setQuitOnLastWindowClosed(false);
KSharedConfig::Ptr startupConf = KSharedConfig::openConfig(QStringLiteral("plasmashellrc"));
KConfigGroup startupConfGroup(startupConf, "Shell");
const QString defaultShell = startupConfGroup.readEntry("ShellPackage", qEnvironmentVariable("PLASMA_DEFAULT_SHELL", "org.kde.plasma.desktop"));
bool replace = false;
ShellCorona *corona;
@ -116,7 +112,7 @@ int main(int argc, char *argv[])
QCommandLineOption shellPluginOption(QStringList() << QStringLiteral("p") << QStringLiteral("shell-plugin"),
i18n("Force loading the given shell plugin"),
QStringLiteral("plugin"),
defaultShell);
ShellCorona::defaultShell());
QCommandLineOption standaloneOption(QStringList() << QStringLiteral("a") << QStringLiteral("standalone"),
i18n("Load plasmashell as a standalone application, needs the shell-plugin option to be specified"));

@ -2127,6 +2127,20 @@ void ShellCorona::activateTaskManagerEntry(int index)
}
}
QString ShellCorona::defaultShell()
{
KSharedConfig::Ptr startupConf = KSharedConfig::openConfig(QStringLiteral("plasmashellrc"));
KConfigGroup startupConfGroup(startupConf, "Shell");
return startupConfGroup.readEntry("ShellPackage", qEnvironmentVariable("PLASMA_DEFAULT_SHELL", "org.kde.plasma.desktop"));
}
void ShellCorona::refreshCurrentShell()
{
KSharedConfig::openConfig(QStringLiteral("plasmashellrc"))->reparseConfiguration();
// FIXME: setShell(defaultShell());
QProcess::startDetached("plasmashell", {"--replace"});
}
// Desktop corona handler
#include "moc_shellcorona.cpp"

@ -106,6 +106,8 @@ public:
QString defaultContainmentPlugin() const;
static QString defaultShell();
Q_SIGNALS:
void glInitializationFailed();
@ -158,6 +160,8 @@ public Q_SLOTS:
return m_panelViews.count();
}
void refreshCurrentShell();
protected Q_SLOTS:
/**
* Loads the layout and performs the needed checks

Loading…
Cancel
Save