|
|
bb34a48 |
From bf11c835ebd934d9916327262f23edb25aeb8ab8 Mon Sep 17 00:00:00 2001
|
|
|
bb34a48 |
From: Nate Graham <nate@kde.org>
|
|
|
bb34a48 |
Date: Thu, 29 Oct 2020 15:00:39 -0600
|
|
|
bb34a48 |
Subject: [PATCH 75/75] Disable session management for daemon
|
|
|
bb34a48 |
|
|
|
bb34a48 |
We don't need to autostart the daemon if it was running at logout.
|
|
|
bb34a48 |
|
|
|
bb34a48 |
BUG: 417219
|
|
|
bb34a48 |
FIXED-IN: 20.12
|
|
|
bb34a48 |
---
|
|
|
bb34a48 |
src/main.cpp | 9 +++++++++
|
|
|
bb34a48 |
1 file changed, 9 insertions(+)
|
|
|
bb34a48 |
|
|
|
bb34a48 |
diff --git a/src/main.cpp b/src/main.cpp
|
|
|
bb34a48 |
index 9191127e5..d557f2ea0 100644
|
|
|
bb34a48 |
--- a/src/main.cpp
|
|
|
bb34a48 |
+++ b/src/main.cpp
|
|
|
bb34a48 |
@@ -26,6 +26,7 @@
|
|
|
bb34a48 |
#include <QDBusInterface>
|
|
|
bb34a48 |
#include <QDBusAbstractInterface>
|
|
|
bb34a48 |
#include <QDBusConnectionInterface>
|
|
|
bb34a48 |
+#include <QSessionManager>
|
|
|
bb34a48 |
|
|
|
bb34a48 |
#ifndef Q_OS_WIN
|
|
|
bb34a48 |
#include <unistd.h>
|
|
|
bb34a48 |
@@ -132,6 +133,14 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
|
|
|
bb34a48 |
|
|
|
bb34a48 |
|
|
|
bb34a48 |
if (parser.isSet(QStringLiteral("daemon"))) {
|
|
|
bb34a48 |
+ // Disable session management for the daemonized version
|
|
|
bb34a48 |
+ // See https://bugs.kde.org/show_bug.cgi?id=417219
|
|
|
bb34a48 |
+ auto disableSessionManagement = [](QSessionManager &sm) {
|
|
|
bb34a48 |
+ sm.setRestartHint(QSessionManager::RestartNever);
|
|
|
bb34a48 |
+ };
|
|
|
bb34a48 |
+ QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement);
|
|
|
bb34a48 |
+ QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement);
|
|
|
bb34a48 |
+
|
|
|
bb34a48 |
KDBusService dolphinDBusService;
|
|
|
bb34a48 |
DBusInterface interface;
|
|
|
bb34a48 |
interface.setAsDaemon();
|
|
|
bb34a48 |
--
|
|
|
bb34a48 |
2.28.0
|
|
|
bb34a48 |
|