[startkde] Move ksplash loading to handle new kwin_wayland

KSplash is changed to read which theme to use directly. It's already
linking config and it already loads the default shared config implicitly
so we weren't saving anything having it done by the launcher.

On X11 ksplash is still managed by startplasma-x11 as we can do it
straight away.

For wayland we need to wait till kwin is up so this is done either by
plasma-session or systemd. For systemd the unit is started explicitly so
we can parse the config file, but after the target starting kwin is
started so that the "After=" line works correctly.
wilder-5.24
David Edmundson 4 years ago
parent ce2caf11b7
commit e2ecf588f6
  1. 1
      ksplash/ksplashqml/CMakeLists.txt
  2. 10
      ksplash/ksplashqml/plasma-ksplash.service.in
  3. 10
      ksplash/ksplashqml/splashapp.cpp
  4. 2
      startkde/plasma-session/startup.cpp
  5. 18
      startkde/startplasma.cpp

@ -23,3 +23,4 @@ target_link_libraries(ksplashqml
install(TARGETS ksplashqml ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES org.kde.KSplash.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR})
ecm_install_configured_files(INPUT plasma-ksplash.service.in @ONLY DESTINATION ${SYSTEMD_USER_UNIT_INSTALL_DIR})

@ -0,0 +1,10 @@
[Unit]
Description=Splash screen shown during boot
PartOf=graphical-session.target
After=plasma-kwin_wayland.service
[Service]
ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/ksplashqml
Type=oneshot
Slice=background.slice
TimeoutSec=40sec

@ -18,6 +18,10 @@
#include <KQuickAddons/QtQuickSettings>
#include <KWindowSystem>
#include <KConfigGroup>
#include <KSharedConfig>
#include <LayerShellQt/Shell>
#define TEST_STEP_INTERVAL 2000
@ -53,6 +57,12 @@ SplashApp::SplashApp(int &argc, char **argv)
m_testing = parser.isSet(QStringLiteral("test"));
m_window = parser.isSet(QStringLiteral("window"));
m_theme = parser.positionalArguments().value(0);
if (m_theme.isEmpty()) {
KConfigGroup ksplashCfg = KSharedConfig::openConfig()->group("KSplash");
if (ksplashCfg.readEntry("Engine", QStringLiteral("KSplashQML")) == QLatin1String("KSplashQML")) {
m_theme = ksplashCfg.readEntry("Theme", QStringLiteral("Breeze"));
}
}
QDBusConnection dbus = QDBusConnection::sessionBus();
dbus.registerObject(QStringLiteral("/KSplash"), this, QDBusConnection::ExportScriptableSlots);

@ -174,7 +174,7 @@ Startup::Startup(QObject *parent)
// the splashscreen and progress indicator
KConfigGroup ksplashCfg = cfg.group("KSplash");
if (ksplashCfg.readEntry("Engine", QStringLiteral("KSplashQML")) == QLatin1String("KSplashQML")) {
QProcess::startDetached(QStringLiteral("ksplashqml"), {ksplashCfg.readEntry("Theme", QStringLiteral("Breeze"))});
QProcess::startDetached(QStringLiteral("ksplashqml"), {});
}
// FIXME 1: this code path is missing setupFontDpi() after X has started. Move to kcminit?
// FIXME 2: the systemd path has no concept of kslpash

@ -540,6 +540,21 @@ bool useSystemdBoot()
return hasSystemdService(QStringLiteral("xdg-desktop-autostart.target"));
}
void startKSplashViaSystemd()
{
const KConfig cfg(QStringLiteral("ksplashrc"));
// the splashscreen and progress indicator
KConfigGroup ksplashCfg = cfg.group("KSplash");
if (ksplashCfg.readEntry("Engine", QStringLiteral("KSplashQML")) == QLatin1String("KSplashQML")) {
auto msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.systemd1"),
QStringLiteral("/org/freedesktop/systemd1"),
QStringLiteral("org.freedesktop.systemd1.Manager"),
QStringLiteral("StartUnit"));
msg << QStringLiteral("plasma-ksplash.service") << QStringLiteral("fail");
QDBusReply<QDBusObjectPath> reply = QDBusConnection::sessionBus().call(msg);
}
}
bool startPlasmaSession(bool wayland)
{
resetSystemdFailedUnits();
@ -628,6 +643,9 @@ bool startPlasmaSession(bool wayland)
} else {
playStartupSound(&e);
}
if (wayland) {
startKSplashViaSystemd();
}
}
if (rc) {
QObject::connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, &e, &QEventLoop::quit);

Loading…
Cancel
Save