diff --git a/daemon/powerdevilapp.cpp b/daemon/powerdevilapp.cpp --- a/daemon/powerdevilapp.cpp +++ b/daemon/powerdevilapp.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -200,6 +201,12 @@ KWorkSpace::detectPlatform(argc, argv); PowerDevilApp app(argc, argv); + auto disableSessionManagement = [](QSessionManager &sm) { + sm.setRestartHint(QSessionManager::RestartNever); + }; + QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement); + QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement); + KDBusService service(KDBusService::Unique); KCrash::setFlags(KCrash::AutoRestart);