diff --git a/ksmserver/legacy.cpp b/ksmserver/legacy.cpp --- a/ksmserver/legacy.cpp +++ b/ksmserver/legacy.cpp @@ -254,44 +254,19 @@ if( config->hasGroup( QStringLiteral( "Legacy" ) + sessionGroup )) { KConfigGroup group( config, QStringLiteral( "Legacy" ) + sessionGroup ); restoreLegacySessionInternal( &group ); - } else if( wm == QLatin1String( "kwin" ) ) { // backwards comp. - get it from kwinrc - KConfigGroup group( config, sessionGroup ); - int count = group.readEntry( "count", 0 ); - for ( int i = 1; i <= count; i++ ) { - QString n = QString::number(i); - if ( !isWM( group.readEntry( QStringLiteral("program")+n, QString()))) - continue; - QStringList restartCommand = - group.readEntry( QStringLiteral("restartCommand")+n, QStringList() ); - for( QStringList::ConstIterator it = restartCommand.constBegin(); - it != restartCommand.constEnd(); - ++it ) { - if( (*it) == QLatin1String( "-session" ) ) { - ++it; - if( it != restartCommand.constEnd()) { - KConfig cfg( QStringLiteral( "session/" ) + wm + - QLatin1Char( '_' ) + (*it) ); - KConfigGroup group(&cfg, "LegacySession"); - restoreLegacySessionInternal( &group, ' ' ); - } - } - } - } } } void KSMServer::restoreLegacySessionInternal( KConfigGroup* config, char sep ) { int count = config->readEntry( "count",0 ); for ( int i = 1; i <= count; i++ ) { QString n = QString::number(i); - QStringList wmCommand = (sep == ',') ? + QStringList wmCommand = (sep == ',') ? // why is this named "wmCommand"? config->readEntry( QStringLiteral("command")+n, QStringList() ) : KShell::splitArgs( config->readEntry( QStringLiteral("command")+n, QString() ) ); // close enough(?) if( wmCommand.isEmpty()) continue; - if( isWM( wmCommand.first())) - continue; startApplication( wmCommand, config->readEntry( QStringLiteral("clientMachine")+n, QString() ), config->readEntry( QStringLiteral("userId")+n, QString() )); diff --git a/ksmserver/logout.cpp b/ksmserver/logout.cpp --- a/ksmserver/logout.cpp +++ b/ksmserver/logout.cpp @@ -191,9 +191,7 @@ QTimer::singleShot(1000, this, &KSMServer::performLogout); } - auto reply = m_kwinInterface->setState(KWinSessionState::Saving); - // we don't need to block as we wait for kwin to handle it's session 1 - // before messaging the clients + auto setStateReply = m_kwinInterface->setState(KWinSessionState::Saving); state = Shutdown; @@ -213,43 +211,37 @@ QPalette palette; palette.setColor( QApplication::desktop()->backgroundRole(), Qt::black ); QApplication::setPalette(palette); - wmPhase1WaitingCount = 0; saveType = saveSession?SmSaveBoth:SmSaveGlobal; #ifndef NO_LEGACY_SESSION_MANAGEMENT performLegacySessionSave(); #endif startProtection(); - foreach( KSMClient* c, clients ) { - c->resetState(); - // Whoever came with the idea of phase 2 got it backwards - // unfortunately. Window manager should be the very first - // one saving session data, not the last one, as possible - // user interaction during session save may alter - // window positions etc. - // Moreover, KWin's focus stealing prevention would lead - // to undesired effects while session saving (dialogs - // wouldn't be activated), so it needs be assured that - // KWin will turn it off temporarily before any other - // user interaction takes place. - // Therefore, make sure the WM finishes its phase 1 - // before others a chance to change anything. - // KWin will check if the session manager is ksmserver, - // and if yes it will save in phase 1 instead of phase 2. - if( isWM( c ) ) - ++wmPhase1WaitingCount; + + // Tell KWin to start saving before we start tearing down clients + // as any "Save changes?" prompt might meddle with the state + if (saveSession) { + setStateReply.waitForFinished(); // do we have to wait for this to finish? + + qCDebug(KSMSERVER) << "Telling KWin we're about to save session" << currentSession(); + + auto saveSessionCall = m_kwinInterface->aboutToSaveSession(currentSession()); + // We need to wait for KWin to save the initial state, e.g. active client and + // current desktop before we signal any clients to quit. They might bring up + // "Save changes?" prompts altering the state. + // KWin doesn't talk to KSMServer directly anymore, so this won't deadlock. + saveSessionCall.waitForFinished(); } - if (wmPhase1WaitingCount > 0) { - foreach( KSMClient* c, clients ) { - if( isWM( c ) ) - SmsSaveYourself( c->connection(), saveType, - true, SmInteractStyleAny, false ); - } - } else { // no WM, simply start them all - foreach( KSMClient* c, clients ) - SmsSaveYourself( c->connection(), saveType, - true, SmInteractStyleAny, false ); + + const auto pendingClients = clients; + + for (KSMClient *c : pendingClients) { + c->resetState(); + + SmsSaveYourself(c->connection(), saveType, true, SmInteractStyleAny, false); } - qCDebug(KSMSERVER) << "clients should be empty, " << clients.isEmpty(); + + qCDebug(KSMSERVER) << "clients should be empty, " << clients.count(); + if ( clients.isEmpty() ) completeShutdownOrCheckpoint(); } @@ -264,25 +256,18 @@ state = Checkpoint; - wmPhase1WaitingCount = 0; saveType = SmSaveLocal; saveSession = true; #ifndef NO_LEGACY_SESSION_MANAGEMENT performLegacySessionSave(); #endif - foreach( KSMClient* c, clients ) { - c->resetState(); - if( isWM( c ) ) - ++wmPhase1WaitingCount; - } - if (wmPhase1WaitingCount > 0) { - foreach( KSMClient* c, clients ) { - if( isWM( c ) ) - SmsSaveYourself( c->connection(), saveType, false, SmInteractStyleNone, false ); - } - } else { - foreach( KSMClient* c, clients ) - SmsSaveYourself( c->connection(), saveType, false, SmInteractStyleNone, false ); + + auto aboutToSaveCall = m_kwinInterface->aboutToSaveSession(currentSession()); + aboutToSaveCall.waitForFinished(); + + const auto pendingClients = clients; + for (KSMClient *c : pendingClients) { + SmsSaveYourself( c->connection(), saveType, false, SmInteractStyleNone, false ); } if ( clients.isEmpty() ) completeShutdownOrCheckpoint(); @@ -320,17 +305,6 @@ completeShutdownOrCheckpoint(); } startProtection(); - if( isWM( client ) && !client->wasPhase2 && wmPhase1WaitingCount > 0 ) { - --wmPhase1WaitingCount; - // WM finished its phase1, save the rest - if( wmPhase1WaitingCount == 0 ) { - foreach( KSMClient* c, clients ) - if( !isWM( c )) - SmsSaveYourself( c->connection(), saveType, saveType != SmSaveLocal, - saveType != SmSaveLocal ? SmInteractStyleAny : SmInteractStyleNone, - false ); - } - } } void KSMServer::interactRequest( KSMClient* client, int /*dialogType*/ ) @@ -360,17 +334,6 @@ client->waitForPhase2 = true; client->wasPhase2 = true; completeShutdownOrCheckpoint(); - if( isWM( client ) && wmPhase1WaitingCount > 0 ) { - --wmPhase1WaitingCount; - // WM finished its phase1 and requests phase2, save the rest - if( wmPhase1WaitingCount == 0 ) { - foreach( KSMClient* c, clients ) - if( !isWM( c )) - SmsSaveYourself( c->connection(), saveType, saveType != SmSaveLocal, - saveType != SmSaveLocal ? SmInteractStyleAny : SmInteractStyleNone, - false ); - } - } } void KSMServer::handlePendingInteractions() @@ -539,8 +502,6 @@ m_kwinInterface->setState(KWinSessionState::Quitting); foreach( KSMClient* c, clients ) { - if( isWM( c )) // kill the WM as the last one in order to reduce flicker - continue; qCDebug(KSMSERVER) << "startKilling: client " << c->program() << "(" << c->clientId() << ")"; SmsDie( c->connection() ); } @@ -558,46 +519,11 @@ if( state == Killing ) { bool wait = false; foreach( KSMClient* c, clients ) { - if( isWM( c )) - continue; wait = true; // still waiting for clients to go away } if( wait ) return; - killWM(); - } -} - -void KSMServer::killWM() -{ - if( state != Killing ) - return; - - qCDebug(KSMSERVER) << "Starting killing WM"; - state = KillingWM; - bool iswm = false; - foreach( KSMClient* c, clients ) { - if( isWM( c )) { - iswm = true; - qCDebug(KSMSERVER) << "killWM: client " << c->program() << "(" << c->clientId() << ")"; - SmsDie( c->connection() ); - } - } - if( iswm ) { - completeKillingWM(); - QTimer::singleShot( 5000, this, &KSMServer::timeoutWMQuit ); - } - else killingCompleted(); -} - -void KSMServer::completeKillingWM() -{ - qCDebug(KSMSERVER) << "KSMServer::completeKillingWM clients.count()=" << - clients.count() << endl; - if( state == KillingWM ) { - if( clients.isEmpty()) - killingCompleted(); } } @@ -617,14 +543,6 @@ foreach( KSMClient* c, clients ) { qCWarning(KSMSERVER) << "SmsDie timeout, client " << c->program() << "(" << c->clientId() << ")" ; } - killWM(); -} - -void KSMServer::timeoutWMQuit() -{ - if( state == KillingWM ) { - qCWarning(KSMSERVER) << "SmsDie WM timeout" ; - } killingCompleted(); } @@ -683,14 +601,9 @@ qCDebug(KSMSERVER) << "KSMServer::completeKillingSubSession clients.count()=" << clients.count() << endl; if( state == KillingSubSession ) { - bool wait = false; - foreach( KSMClient* c, clientsToKill ) { - if( isWM( c )) - continue; - wait = true; // still waiting for clients to go away + if (!clientsToKill.isEmpty()) { + return; // still waiting for clients to go away } - if( wait ) - return; signalSubSessionClosed(); } } diff --git a/ksmserver/main.cpp b/ksmserver/main.cpp --- a/ksmserver/main.cpp +++ b/ksmserver/main.cpp @@ -266,11 +266,6 @@ i18n("Restores the saved user session if available")); parser.addOption(restoreOption); - QCommandLineOption wmOption(QStringList() << QStringLiteral("w") << QStringLiteral("windowmanager"), - i18n("Starts in case no other window manager is \nparticipating in the session. Default is 'kwin'"), - i18n("wm")); - parser.addOption(wmOption); - QCommandLineOption nolocalOption(QStringLiteral("nolocal"), i18n("Also allow remote connections")); parser.addOption(nolocalOption); @@ -285,8 +280,6 @@ parser.process(*a); - QString wm = parser.value(wmOption); - bool only_local = !parser.isSet(nolocalOption); #ifndef HAVE__ICETRANSNOLISTEN /* this seems strange, but the default is only_local, so if !only_local @@ -310,7 +303,7 @@ flags |= KSMServer::InitFlag::NoLockScreen; } - KSMServer *server = new KSMServer( wm, flags); + KSMServer *server = new KSMServer(flags); // for the KDE-already-running check in startkde KSelectionOwner kde_running( "_KDE_RUNNING", 0 ); diff --git a/ksmserver/org.kde.KWin.Session.xml b/ksmserver/org.kde.KWin.Session.xml --- a/ksmserver/org.kde.KWin.Session.xml +++ b/ksmserver/org.kde.KWin.Session.xml @@ -1,14 +1,23 @@ - + + - + - - - - + + + + + + + + + + + + diff --git a/ksmserver/server.h b/ksmserver/server.h --- a/ksmserver/server.h +++ b/ksmserver/server.h @@ -86,7 +86,7 @@ }; Q_DECLARE_FLAGS(InitFlags, InitFlag) - KSMServer( const QString& windowManager, InitFlags flags ); + KSMServer(InitFlags flags ); ~KSMServer() override; static KSMServer* self(); @@ -107,7 +107,6 @@ void ioError( IceConn iceConn ); // notification - void clientSetProgram( KSMClient* client ); void clientRegistered( const char* previousId ); // public API @@ -122,7 +121,6 @@ void setupShortcuts(); Q_SIGNALS: - void windowManagerLoaded(); void logoutCancelled(); public Q_SLOTS: @@ -135,9 +133,6 @@ void protectionTimeout(); void timeoutQuit(); - void timeoutWMQuit(); - - void wmProcessChange(); void defaultLogout(); void logoutWithoutConfirmation(); @@ -152,9 +147,7 @@ void performStandardKilling(); void completeKilling(); void completeKillingSubSession(); - void killWM(); void signalSubSessionClosed(); - void completeKillingWM(); void cancelShutdown( KSMClient* c ); void killingCompleted(); @@ -164,16 +157,12 @@ void startProtection(); void endProtection(); - void launchWM( const QList< QStringList >& wmStartCommands ); - KProcess* startApplication( const QStringList& command, const QString& clientMachine = QString(), const QString& userId = QString(), bool wm = false ); void executeCommand( const QStringList& command ); - bool isWM( const KSMClient* client ) const; - bool isWM( const QString& program ) const; bool defaultSession() const; // empty session void setupXIOErrorHandler(); @@ -222,22 +211,17 @@ enum State { Idle, - LaunchingWM, Restoring, - Shutdown, Checkpoint, Killing, KillingWM, WaitingForKNotify, // shutdown + RestoringWMSession, Restoring, + Shutdown, Checkpoint, Killing, WaitingForKNotify, // shutdown ClosingSubSession, KillingSubSession, RestoringSubSession }; State state; bool saveSession; - int wmPhase1WaitingCount; int saveType; bool clean; KSMClient* clientInteracting; - QString wm; - QStringList wmCommands; - KProcess* wmProcess; QString sessionGroup; - QString sessionName; QTimer protectionTimer; QTimer restoreTimer; QString xonCommand; diff --git a/ksmserver/server.cpp b/ksmserver/server.cpp --- a/ksmserver/server.cpp +++ b/ksmserver/server.cpp @@ -279,8 +279,6 @@ SmFreeProperty( p ); } client->properties.append( props[i] ); - if ( !qstrcmp( props[i]->name, SmProgram ) ) - the_server->clientSetProgram( client ); } if ( numProps ) @@ -597,9 +595,8 @@ extern "C" int _IceTransNoListen(const char * protocol); #endif -KSMServer::KSMServer( const QString& windowManager, InitFlags flags ) - : wmProcess( nullptr ) - , sessionGroup( QStringLiteral( "" ) ) +KSMServer::KSMServer(InitFlags flags) + : sessionGroup( QStringLiteral( "" ) ) , m_kwinInterface(new OrgKdeKWinSessionInterface(QStringLiteral("org.kde.KWin"), QStringLiteral("/Session"), QDBusConnection::sessionBus(), this)) , sockets{ -1, -1 } { @@ -623,18 +620,10 @@ state = Idle; saveSession = false; - wmPhase1WaitingCount = 0; KConfigGroup config(KSharedConfig::openConfig(), "General"); clientInteracting = nullptr; xonCommand = config.readEntry( "xonCommand", "xon" ); - if (windowManager.isEmpty()) { - wm = QStringLiteral(KWIN_BIN); - } else { - wm = windowManager; - } - wmCommands = QStringList({wm}); - only_local = flags.testFlag(InitFlag::OnlyLocal); #ifdef HAVE__ICETRANSNOLISTEN if (only_local) @@ -832,8 +821,6 @@ completeKilling(); else if ( state == KillingSubSession ) completeKillingSubSession(); - if ( state == KillingWM ) - completeKillingWM(); } void KSMServer::newConnection( int /*socket*/ ) @@ -861,12 +848,11 @@ fcntl( IceConnectionNumber(iceConn), F_SETFD, FD_CLOEXEC ); } - QString KSMServer::currentSession() { if ( sessionGroup.startsWith( QLatin1String( "Session: " ) ) ) return sessionGroup.mid( 9 ); - return QStringLiteral( "" ); // empty, not null, since used for KConfig::setGroup + return QStringLiteral( "" ); // empty, not null, since used for KConfig::setGroup // TODO does this comment make any sense? } void KSMServer::discardSession() @@ -917,15 +903,9 @@ KConfigGroup cg( config, sessionGroup); count = 0; - if (state != ClosingSubSession) { - // put the wm first - foreach ( KSMClient *c, clients ) - if ( c->program() == wm ) { - clients.removeAll( c ); - clients.prepend( c ); - break; - } - } + // Tell kwin to save its state + auto reply = m_kwinInterface->finishSaveSession(currentSession()); + reply.waitForFinished(); // boo! foreach ( KSMClient *c, clients ) { int restartHint = c->restartStyleHint(); @@ -956,7 +936,6 @@ cg.writePathEntry( QStringLiteral("discardCommand")+n, c->discardCommand() ); cg.writeEntry( QStringLiteral("restartStyleHint")+n, restartHint ); cg.writeEntry( QStringLiteral("userId")+n, c->userId() ); - cg.writeEntry( QStringLiteral("wasWm")+n, isWM( c )); } cg.writeEntry( "count", count ); @@ -977,19 +956,6 @@ return sessions; } -bool KSMServer::isWM( const KSMClient* client ) const -{ - return isWM( client->program()); -} - -bool KSMServer::isWM( const QString& program ) const -{ - // Strip possible paths, so that even /usr/bin/kwin is recognized as kwin. - QString wmName = wm.mid( wm.lastIndexOf( QDir::separator()) + 1 ); - QString programName = program.mid( program.lastIndexOf( QDir::separator()) + 1 ); - return programName == wmName; -} - bool KSMServer::defaultSession() const { return sessionGroup.isEmpty(); @@ -1022,17 +988,16 @@ } } -/*! Restores the previous session. Ensures the window manager is - running (if specified). +/*! Restores the previous session. */ void KSMServer::restoreSession( const QString &sessionName ) { if( state != Idle ) return; #ifdef KSMSERVER_STARTUP_DEBUG1 t.start(); #endif - state = LaunchingWM; + state = RestoringWMSession; qCDebug(KSMSERVER) << "KSMServer::restoreSession " << sessionName; KSharedConfig::Ptr config = KSharedConfig::openConfig(); @@ -1043,73 +1008,28 @@ int count = configSessionGroup.readEntry( "count", 0 ); appsToStart = count; - // 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() ); - } + auto reply = m_kwinInterface->loadSession(sessionName); + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this); + connect(watcher, &QDBusPendingCallWatcher::finished, this, [this](QDBusPendingCallWatcher *watcher) { + watcher->deleteLater(); + if (state == RestoringWMSession) { + state = Idle; } - } - if( wmStartCommands.isEmpty()) // otherwise use the configured default - wmStartCommands << wmCommands; - - launchWM( wmStartCommands ); -} - -void KSMServer::launchWM( const QList< QStringList >& wmStartCommands ) -{ - assert( state == LaunchingWM ); - - if (!(qEnvironmentVariableIsSet("WAYLAND_DISPLAY") || qEnvironmentVariableIsSet("WAYLAND_SOCKET"))) { - // 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() -{ - if( state != LaunchingWM ) - { // don't care about the process when not in the wm-launching state anymore - wmProcess = nullptr; - return; - } - if( wmProcess->state() == QProcess::NotRunning ) - { // wm failed to launch for some reason, go with kwin instead - qCWarning(KSMSERVER) << "Window manager" << wm << "failed to launch"; - if( wm == QLatin1String( KWIN_BIN ) ) - return; // uhoh, kwin itself failed - qCDebug(KSMSERVER) << "Launching KWin"; - wm = QStringLiteral( KWIN_BIN ); - wmCommands = ( QStringList() << QStringLiteral( KWIN_BIN ) ); - // launch it - launchWM( QList< QStringList >() << wmCommands ); - return; - } + }); } /*! Starts the default session. - - Currently, that's the window manager only (if specified). */ void KSMServer::startDefaultSession() { if( state != Idle ) return; - state = LaunchingWM; + state = RestoringWMSession; #ifdef KSMSERVER_STARTUP_DEBUG1 t.start(); #endif sessionGroup = QString(); - launchWM( QList< QStringList >() << wmCommands ); } void KSMServer::restoreSession() @@ -1149,13 +1069,6 @@ tryRestoreNext(); } -void KSMServer::clientSetProgram( KSMClient* client ) -{ - if( client->program() == wm ) { - emit windowManagerLoaded(); - } -} - void KSMServer::clientRegistered( const char* previousId ) { if ( previousId && lastIdStarted == QString::fromLocal8Bit( previousId ) ) @@ -1188,10 +1101,6 @@ (config.readEntry( QStringLiteral("restartStyleHint")+n, 0 ) == SmRestartNever)) { continue; } - if ( isWM( config.readEntry( QStringLiteral("program")+n, QString())) ) - continue; // wm already started - if( config.readEntry( QStringLiteral( "wasWm" )+n, false )) - continue; // it was wm before, but not now, don't run it (some have --replace in command :( ) startApplication( restartCommand, config.readEntry( QStringLiteral("clientMachine")+n, QString() ), config.readEntry( QStringLiteral("userId")+n, QString() )); diff --git a/startkde/config-startplasma.h.cmake b/startkde/config-startplasma.h.cmake --- a/startkde/config-startplasma.h.cmake +++ b/startkde/config-startplasma.h.cmake @@ -7,4 +7,6 @@ #define CMAKE_INSTALL_FULL_LIBEXECDIR_KF5 "@CMAKE_INSTALL_FULL_LIBEXECDIR_KF5@" #define KWIN_WAYLAND_BIN_PATH "@KWIN_WAYLAND_BIN_PATH@" +#define KWIN_BIN "${KWIN_BIN}" + #endif diff --git a/startkde/plasma-session/startup.cpp b/startkde/plasma-session/startup.cpp --- a/startkde/plasma-session/startup.cpp +++ b/startkde/plasma-session/startup.cpp @@ -214,17 +214,39 @@ QProcessEnvironment kdedProcessEnv; kdedProcessEnv.insert(QStringLiteral("KDED_STARTED_BY_KDEINIT"), QStringLiteral("1")); + KJob *windowManagerJob = nullptr; + + if (qEnvironmentVariable("XDG_SESSION_TYPE") != QLatin1String("wayland")) { + QString windowManager; + if (qEnvironmentVariableIsSet("KDEWM")) { + windowManager = qEnvironmentVariable("KDEWM"); + } + if (windowManager.isEmpty()) { + windowManager = QStringLiteral(KWIN_BIN); + } + + if (windowManager == QLatin1String(KWIN_BIN)) { + windowManagerJob = new StartServiceJob(windowManager, {}, QStringLiteral("org.kde.KWin")); + } else { + windowManagerJob = new StartServiceJob(windowManager, {}, {}); + } + } + const QVector sequence = { new StartProcessJob(QStringLiteral("kcminit_startup"), {}), new StartServiceJob(QStringLiteral("kded5"), {}, QStringLiteral("org.kde.kded5"), kdedProcessEnv), + windowManagerJob, new StartServiceJob(QStringLiteral("ksmserver"), QCoreApplication::instance()->arguments().mid(1), QStringLiteral("org.kde.ksmserver")), new StartupPhase0(autostart, this), phase1 = new StartupPhase1(autostart, this), new RestoreSessionJob(), new StartupPhase2(autostart, this), }; KJob* last = nullptr; for(KJob* job : sequence) { + if (!job) { + continue; + } if (last) { connect(last, &KJob::finished, job, &KJob::start); } @@ -436,7 +458,7 @@ env.insert(m_additionalEnv); m_process->setProcessEnvironment(env); - if (QDBusConnection::sessionBus().interface()->isServiceRegistered(m_serviceId)) { + if (!m_serviceId.isEmpty() && QDBusConnection::sessionBus().interface()->isServiceRegistered(m_serviceId)) { qCDebug(PLASMA_SESSION) << m_process << "already running"; emitResult(); return; @@ -446,6 +468,10 @@ qCWarning(PLASMA_SESSION) << "error starting process" << m_process->program() << m_process->arguments(); emitResult(); } + + if (m_serviceId.isEmpty()) { + emitResult(); + } } StartProcessJob::StartProcessJob(const QString &process, const QStringList &args, const QProcessEnvironment &additionalEnv) diff --git a/startkde/startplasma.cpp b/startkde/startplasma.cpp --- a/startkde/startplasma.cpp +++ b/startkde/startplasma.cpp @@ -17,6 +17,8 @@ Boston, MA 02110-1301, USA. */ +#include + #include #include #include @@ -321,7 +323,6 @@ return p; } - void setupGSLib() // Get Ghostscript to look into user's KDE fonts dir for additional Fontmap { @@ -355,9 +356,6 @@ if (wayland) { plasmaSessionOptions << QStringLiteral("--no-lockscreen"); } else { - if (qEnvironmentVariableIsSet("KDEWM")) { - plasmaSessionOptions << QStringLiteral("--windowmanager") << qEnvironmentVariable("KDEWM"); - } if (desktopLockedAtStart) { plasmaSessionOptions << QStringLiteral("--lockscreen"); }