parent
209e18922b
commit
f1bef0cf99
@ -0,0 +1,170 @@
|
|||||||
|
From da34fd073f6b361fde1fdcee559d60e8c0268cd6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Edmundson <kde@davidedmundson.co.uk>
|
||||||
|
Date: Sat, 7 Nov 2020 23:52:12 +0000
|
||||||
|
Subject: [PATCH] Revert "Use new simpler way to disable session management in
|
||||||
|
services"
|
||||||
|
|
||||||
|
The two ways of disabling session management have the same impact on the
|
||||||
|
session being saved, but there is one behavioural side-effect that
|
||||||
|
turned out to be less ideal.
|
||||||
|
|
||||||
|
By disabling completely we don't follow the session manager telling the
|
||||||
|
application to quit. That's not something needed with the systemd boot,
|
||||||
|
but for the legacy boot effectively we were just closing applications by
|
||||||
|
ripping the X connection away from under them.
|
||||||
|
|
||||||
|
Some applications are bad at handling this and this led to a bunch of
|
||||||
|
crashes or dangling processes at logout.
|
||||||
|
|
||||||
|
This reverts commit 9be7dedb87ea574916f0f8a2837eaf7b19a7a166.
|
||||||
|
|
||||||
|
CCBUG: 424408
|
||||||
|
|
||||||
|
|
||||||
|
(cherry picked from commit 9e641d41717911f835fba59eb5fab6bbf97f8502)
|
||||||
|
---
|
||||||
|
gmenu-dbusmenu-proxy/main.cpp | 8 +++++++-
|
||||||
|
krunner/main.cpp | 10 +++++++++-
|
||||||
|
shell/main.cpp | 10 +++++++++-
|
||||||
|
xembed-sni-proxy/main.cpp | 8 +++++++-
|
||||||
|
4 files changed, 32 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/gmenu-dbusmenu-proxy/main.cpp b/gmenu-dbusmenu-proxy/main.cpp
|
||||||
|
index 632321289..cd32b10f6 100644
|
||||||
|
--- a/gmenu-dbusmenu-proxy/main.cpp
|
||||||
|
+++ b/gmenu-dbusmenu-proxy/main.cpp
|
||||||
|
@@ -18,6 +18,7 @@
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <QGuiApplication>
|
||||||
|
+#include <QSessionManager>
|
||||||
|
|
||||||
|
#include <KWindowSystem>
|
||||||
|
|
||||||
|
@@ -28,7 +29,6 @@ int main(int argc, char ** argv)
|
||||||
|
qputenv("QT_QPA_PLATFORM", "xcb");
|
||||||
|
|
||||||
|
QGuiApplication::setDesktopSettingsAware(false);
|
||||||
|
- QCoreApplication::setAttribute(Qt::AA_DisableSessionManager);
|
||||||
|
|
||||||
|
QGuiApplication app(argc, argv);
|
||||||
|
|
||||||
|
@@ -36,6 +36,12 @@ int main(int argc, char ** argv)
|
||||||
|
qFatal("qdbusmenuproxy is only useful XCB. Aborting");
|
||||||
|
}
|
||||||
|
|
||||||
|
+ auto disableSessionManagement = [](QSessionManager &sm) {
|
||||||
|
+ sm.setRestartHint(QSessionManager::RestartNever);
|
||||||
|
+ };
|
||||||
|
+ QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement);
|
||||||
|
+ QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement);
|
||||||
|
+
|
||||||
|
app.setQuitOnLastWindowClosed(false);
|
||||||
|
|
||||||
|
MenuProxy proxy;
|
||||||
|
diff --git a/krunner/main.cpp b/krunner/main.cpp
|
||||||
|
index cbf0dff83..bbf20743e 100644
|
||||||
|
--- a/krunner/main.cpp
|
||||||
|
+++ b/krunner/main.cpp
|
||||||
|
@@ -24,6 +24,7 @@
|
||||||
|
#include <QUrl>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QQuickWindow>
|
||||||
|
+#include <QSessionManager>
|
||||||
|
#include <QDBusMessage>
|
||||||
|
#include <QDBusConnection>
|
||||||
|
|
||||||
|
@@ -41,7 +42,6 @@
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
QCommandLineParser parser;
|
||||||
|
- QCoreApplication::setAttribute(Qt::AA_DisableSessionManager);
|
||||||
|
if (!qEnvironmentVariableIsSet("PLASMA_USE_QT_SCALING")) {
|
||||||
|
qunsetenv("QT_DEVICE_PIXEL_RATIO");
|
||||||
|
QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
|
||||||
|
@@ -93,6 +93,14 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
|
KDBusService service(KDBusService::Unique | KDBusService::StartupOption(parser.isSet(replaceOption) ? KDBusService::Replace : 0));
|
||||||
|
|
||||||
|
+ QGuiApplication::setFallbackSessionManagementEnabled(false);
|
||||||
|
+
|
||||||
|
+ auto disableSessionManagement = [](QSessionManager &sm) {
|
||||||
|
+ sm.setRestartHint(QSessionManager::RestartNever);
|
||||||
|
+ };
|
||||||
|
+ QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement);
|
||||||
|
+ QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement);
|
||||||
|
+
|
||||||
|
View view;
|
||||||
|
|
||||||
|
auto updateVisibility = [&]() {
|
||||||
|
diff --git a/shell/main.cpp b/shell/main.cpp
|
||||||
|
index 1000b5a97..d82993271 100644
|
||||||
|
--- a/shell/main.cpp
|
||||||
|
+++ b/shell/main.cpp
|
||||||
|
@@ -21,6 +21,7 @@
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QCommandLineParser>
|
||||||
|
#include <QQuickWindow>
|
||||||
|
+#include <QSessionManager>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QProcess>
|
||||||
|
#include <QMessageBox>
|
||||||
|
@@ -83,7 +84,6 @@ int main(int argc, char *argv[])
|
||||||
|
} else {
|
||||||
|
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||||
|
}
|
||||||
|
- QCoreApplication::setAttribute(Qt::AA_DisableSessionManager);
|
||||||
|
|
||||||
|
QQuickWindow::setDefaultAlphaBuffer(true);
|
||||||
|
|
||||||
|
@@ -162,6 +162,14 @@ int main(int argc, char *argv[])
|
||||||
|
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);
|
||||||
|
+
|
||||||
|
ShellCorona* corona = new ShellCorona(&app);
|
||||||
|
corona->setShell(cliOptions.value(shellPluginOption));
|
||||||
|
|
||||||
|
diff --git a/xembed-sni-proxy/main.cpp b/xembed-sni-proxy/main.cpp
|
||||||
|
index 05fd6bf32..8b0078234 100644
|
||||||
|
--- a/xembed-sni-proxy/main.cpp
|
||||||
|
+++ b/xembed-sni-proxy/main.cpp
|
||||||
|
@@ -19,6 +19,7 @@
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <QGuiApplication>
|
||||||
|
+#include <QSessionManager>
|
||||||
|
|
||||||
|
#include "fdoselectionmanager.h"
|
||||||
|
|
||||||
|
@@ -41,7 +42,6 @@ int main(int argc, char ** argv)
|
||||||
|
qputenv("QT_QPA_PLATFORM", "xcb");
|
||||||
|
|
||||||
|
QGuiApplication::setDesktopSettingsAware(false);
|
||||||
|
- QCoreApplication::setAttribute(Qt::AA_DisableSessionManager);
|
||||||
|
|
||||||
|
QGuiApplication app(argc, argv);
|
||||||
|
|
||||||
|
@@ -49,6 +49,12 @@ int main(int argc, char ** argv)
|
||||||
|
qFatal("xembed-sni-proxy is only useful XCB. Aborting");
|
||||||
|
}
|
||||||
|
|
||||||
|
+ auto disableSessionManagement = [](QSessionManager &sm) {
|
||||||
|
+ sm.setRestartHint(QSessionManager::RestartNever);
|
||||||
|
+ };
|
||||||
|
+ QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement);
|
||||||
|
+ QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement);
|
||||||
|
+
|
||||||
|
app.setQuitOnLastWindowClosed(false);
|
||||||
|
|
||||||
|
qDBusRegisterMetaType<KDbusImageStruct>();
|
||||||
|
--
|
||||||
|
GitLab
|
||||||
|
|
Loading…
Reference in new issue