Commit ee3f33ba authored by David Edmundson's avatar David Edmundson

Exclude kscreen backend launcher from session management

Summary: Found in my ksmserverrc being restarted every session.

Test Plan: Code is copied from plasmashell

Reviewers: #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D19025
parent c7314e5d
......@@ -19,6 +19,7 @@
#include <QGuiApplication>
#include <QDBusConnection>
#include <QSessionManager>
#include "kscreen_backendLauncher_debug.h"
#include "backendloader.h"
......@@ -30,6 +31,12 @@ int main(int argc, char **argv)
QGuiApplication::setDesktopSettingsAware(false);
QGuiApplication app(argc, argv);
auto disableSessionManagement = [](QSessionManager &sm) {
sm.setRestartHint(QSessionManager::RestartNever);
};
QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement);
QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement);
if (!QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.KScreen"))) {
qCWarning(KSCREEN_BACKEND_LAUNCHER) << "Cannot register org.kde.KScreen service. Another launcher already running?";
return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment