diff --git a/shell/main.cpp b/shell/main.cpp --- a/shell/main.cpp +++ b/shell/main.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -63,13 +62,21 @@ QQuickWindow::setDefaultAlphaBuffer(true); + // Avoid talking to ksmserver which is pretty busy on login + const QByteArray sessionManagerVariable = qgetenv("SESSION_MANAGER"); + qunsetenv("SESSION_MANAGER"); + const bool qpaVariable = qEnvironmentVariableIsSet("QT_QPA_PLATFORM"); KWorkSpace::detectPlatform(argc, argv); QApplication app(argc, argv); if (!qpaVariable) { // don't leak the env variable to processes we start qunsetenv("QT_QPA_PLATFORM"); } + + // Since we spawn processes from plasmashell, restore variable + qputenv("SESSION_MANAGER", sessionManagerVariable); + KLocalizedString::setApplicationDomain("plasmashell"); // The executable's path is added to the library/plugin paths. @@ -123,14 +130,6 @@ cliOptions.process(app); aboutData.processCommandLine(&cliOptions); - QGuiApplication::setFallbackSessionManagementEnabled(false); - - auto disableSessionManagement = [](QSessionManager &sm) { - sm.setRestartHint(QSessionManager::RestartNever); - }; - QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement); - QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement); - ShellManager::s_fixedShell = cliOptions.value(shellPluginOption); if (!cliOptions.isSet(noRespawnOption) && !cliOptions.isSet(testOption)) {