diff --git a/ksmserver/server.cpp b/ksmserver/server.cpp index ccaffde4f..8407c452e 100644 --- a/ksmserver/server.cpp +++ b/ksmserver/server.cpp @@ -1042,48 +1042,10 @@ void KSMServer::restoreSession( const QString &sessionName ) sessionGroup = QLatin1String("Session: ") + sessionName; KConfigGroup configSessionGroup( config, sessionGroup); - int count = configSessionGroup.readEntry( "count", 0 ); - appsToStart = count; + kwinDBusInterface->loadingSession(sessionName); - // find all commands to launch the wm in the session - QList wmStartCommands; - if ( !wm.isEmpty() ) { - for ( int i = 1; i <= count; i++ ) { - QString n = QString::number(i); - if ( isWM( configSessionGroup.readEntry( QStringLiteral("program")+n, QString())) ) { - wmStartCommands << configSessionGroup.readEntry( QStringLiteral("restartCommand")+n, QStringList() ); - } - } - } - if( wmStartCommands.isEmpty()) // otherwise use the configured default - wmStartCommands << wmCommands; - - launchWM( wmStartCommands ); } -void KSMServer::launchWM( const QList< QStringList >& wmStartCommands ) -{ - assert( state == LaunchingWM ); - - bool shouldLaunchWm = true; - if (qEnvironmentVariableIsSet("WAYLAND_DISPLAY") || qEnvironmentVariableIsSet("WAYLAND_SOCKET")) { - shouldLaunchWm = false; - } - -#ifdef PLASMA_SYSTEMD_BOOT - shouldLaunchWm = false; -#endif - - if (shouldLaunchWm) { - // when we have a window manager, we start it first and give - // it some time before launching other processes. Results in a - // visually more appealing startup. - wmProcess = startApplication( wmStartCommands[ 0 ], QString(), QString(), true ); - connect( wmProcess, SIGNAL(error(QProcess::ProcessError)), SLOT(wmProcessChange())); - connect( wmProcess, SIGNAL(finished(int,QProcess::ExitStatus)), SLOT(wmProcessChange())); - } - emit windowManagerLoaded(); -} void KSMServer::wmProcessChange() {