From 8d7faee0f6dcd4d02490787351f1086846019ea4 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 3 Dec 2020 12:41:11 +0000 Subject: [PATCH] [plasma-shutdown] Avoid timeout when closing ksmserver closeSession returns only when the task is complete, a sound API, but we need to remember to increase the timeout. If a user has unsaved changes in kate, they could handle that prompt after an indefinite period of time. We would still want to shutdown afterwards. Currently plasma-shutdown would abort if it thought ksmserver timed out. Not seen in real life, just spotted in code review. --- startkde/plasma-shutdown/shutdown.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/startkde/plasma-shutdown/shutdown.cpp b/startkde/plasma-shutdown/shutdown.cpp index ad21b622a..751746526 100644 --- a/startkde/plasma-shutdown/shutdown.cpp +++ b/startkde/plasma-shutdown/shutdown.cpp @@ -43,6 +43,8 @@ void Shutdown::startLogout(KWorkSpace::ShutdownType shutdownType) m_shutdownType = shutdownType; OrgKdeKSMServerInterfaceInterface ksmserverIface(QStringLiteral("org.kde.ksmserver"), QStringLiteral("/KSMServer"), QDBusConnection::sessionBus()); + ksmserverIface.setTimeout(INT32_MAX); // KSMServer closeSession can take a long time to reply, as apps may have prompts. Value corresponds to DBUS_TIMEOUT_INFINITE + auto closeSessionReply = ksmserverIface.closeSession(); auto watcher = new QDBusPendingCallWatcher(closeSessionReply, this); connect(watcher, &QDBusPendingCallWatcher::finished, this, [closeSessionReply, watcher, this]() {