diff --git a/shell/shellcorona.h b/shell/shellcorona.h --- a/shell/shellcorona.h +++ b/shell/shellcorona.h @@ -218,6 +218,7 @@ DesktopView* desktopForScreen(QScreen *screen) const; void setupWaylandIntegration(); void executeSetupPlasmoidScript(Plasma::Containment *containment, Plasma::Applet *applet); + void checkAllDesktopsUiReady(bool ready); #ifndef NDEBUG void screenInvariants() const; diff --git a/shell/shellcorona.cpp b/shell/shellcorona.cpp --- a/shell/shellcorona.cpp +++ b/shell/shellcorona.cpp @@ -138,18 +138,6 @@ QDBusConnection dbus = QDBusConnection::sessionBus(); dbus.registerObject(QStringLiteral("/PlasmaShell"), this); - connect(this, &Plasma::Corona::startupCompleted, this, - []() { - qDebug() << "Plasma Shell startup completed"; - QDBusMessage ksplashProgressMessage = QDBusMessage::createMethodCall(QStringLiteral("org.kde.KSplash"), - QStringLiteral("/KSplash"), - QStringLiteral("org.kde.KSplash"), - QStringLiteral("setStage")); - ksplashProgressMessage.setArguments(QList() << QStringLiteral("desktop")); - QDBusConnection::sessionBus().asyncCall(ksplashProgressMessage); - //TODO: remove - }); - // Look for theme config in plasmarc, if it isn't configured, take the theme from the // LookAndFeel package, if either is set, change the default theme @@ -1231,6 +1219,8 @@ removeAction->deleteLater(); } + connect(containment, &Plasma::Containment::uiReadyChanged, this, &ShellCorona::checkAllDesktopsUiReady); + m_screenPool->insertScreenMapping(insertPosition, screen->name()); m_desktopViewforId[insertPosition] = view; view->setContainment(containment); @@ -1252,6 +1242,24 @@ CHECK_SCREEN_INVARIANTS } +void ShellCorona::checkAllDesktopsUiReady(bool ready) +{ + if (!ready) + return; + for (auto v : qAsConst(m_desktopViewforId)) { + if (!v->containment()->isUiReady()) + return; + + qDebug() << "Plasma Shell startup completed"; + QDBusMessage ksplashProgressMessage = QDBusMessage::createMethodCall(QStringLiteral("org.kde.KSplash"), + QStringLiteral("/KSplash"), + QStringLiteral("org.kde.KSplash"), + QStringLiteral("setStage")); + ksplashProgressMessage.setArguments(QList() << QStringLiteral("desktop")); + QDBusConnection::sessionBus().asyncCall(ksplashProgressMessage); + } +} + Plasma::Containment *ShellCorona::createContainmentForActivity(const QString& activity, int screenNum) { for (Plasma::Containment *cont : containmentsForActivity(activity)) {