Commit aea488be authored by David Edmundson's avatar David Edmundson

Add an explicit method to close kwin

On X Kwin's lifespan used to be managed by XSMP. This accidentally broke
in 5.20 as we made kwin start before ksmserver for speed purposes and
wayland preparation.

This leaves kwin to be killed by the display manager as the X connection
closes, but this can lead to deadlocks.

BUG:428817

On wayland kwin's lifespan is mapped to the lifespan of the ksmserver
binary. This is problematic as it makes our entire xwayland robustness
redundant if we ultimately rely on an application that /has/ to run in
xwayland.
parent 0f7a00f1
......@@ -19,5 +19,8 @@
<method name="finishSaveSession">
<arg name="name" type="s" direction="in" />
</method>
<!-- Shutdown kwin at the end of the session -->
<method name="quit">
</method>
</interface>
</node>
......@@ -8,6 +8,7 @@ ecm_qt_declare_logging_category(plasma_shutdown_SRCS HEADER debug.h IDENTIFIER
qt5_add_dbus_adaptor(plasma_shutdown_SRCS org.kde.Shutdown.xml shutdown.h Shutdown)
qt5_add_dbus_interface(plasma_shutdown_SRCS org.kde.Shutdown.xml shutdown_interface)
qt5_add_dbus_interface( plasma_shutdown_SRCS ../../ksmserver/org.kde.KSMServerInterface.xml ksmserver_interface )
qt5_add_dbus_interface( plasma_shutdown_SRCS ../../ksmserver/org.kde.KWin.Session.xml kwin_interface )
add_executable(plasma-shutdown ${plasma_shutdown_SRCS})
......
......@@ -9,6 +9,7 @@
#include "sessionmanagementbackend.h"
#include "ksmserver_interface.h"
#include "kwin_interface.h"
#include "debug.h"
......@@ -66,6 +67,12 @@ void Shutdown::logoutCancelled()
void Shutdown::logoutComplete() {
runShutdownScripts();
// technically this isn't needed in the systemd managed mode, but it seems harmless for now. Guard if it becomes an issue
OrgKdeKWinSessionInterface kwinInterface(QStringLiteral("org.kde.KWin"), QStringLiteral("/Session"), QDBusConnection::sessionBus());
QDBusPendingReply<> reply = kwinInterface.quit();
reply.waitForFinished();
if (m_shutdownType == KWorkSpace::ShutdownTypeHalt) {
SessionBackend::self()->shutdown();
} else if (m_shutdownType == KWorkSpace::ShutdownTypeReboot) {
......
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