diff --git a/ksplash/ksplashqml/CMakeLists.txt b/ksplash/ksplashqml/CMakeLists.txt index dc6b35ba6..624ecac82 100644 --- a/ksplash/ksplashqml/CMakeLists.txt +++ b/ksplash/ksplashqml/CMakeLists.txt @@ -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}) diff --git a/ksplash/ksplashqml/plasma-ksplash.service.in b/ksplash/ksplashqml/plasma-ksplash.service.in new file mode 100644 index 000000000..95bea6c19 --- /dev/null +++ b/ksplash/ksplashqml/plasma-ksplash.service.in @@ -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 diff --git a/ksplash/ksplashqml/splashapp.cpp b/ksplash/ksplashqml/splashapp.cpp index 48ab32e7e..3933efcc3 100644 --- a/ksplash/ksplashqml/splashapp.cpp +++ b/ksplash/ksplashqml/splashapp.cpp @@ -18,6 +18,10 @@ #include #include + +#include +#include + #include #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); diff --git a/startkde/plasma-session/startup.cpp b/startkde/plasma-session/startup.cpp index 8ca22f13a..d64c7bdec 100644 --- a/startkde/plasma-session/startup.cpp +++ b/startkde/plasma-session/startup.cpp @@ -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 diff --git a/startkde/startplasma.cpp b/startkde/startplasma.cpp index c622e024e..afab505ba 100644 --- a/startkde/startplasma.cpp +++ b/startkde/startplasma.cpp @@ -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 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);