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.
wilder-5.22
David Edmundson 5 years ago
parent 0f7a00f157
commit aea488be1e
  1. 3
      ksmserver/org.kde.KWin.Session.xml
  2. 1
      startkde/plasma-shutdown/CMakeLists.txt
  3. 7
      startkde/plasma-shutdown/shutdown.cpp

@ -19,5 +19,8 @@
<method name="finishSaveSession"> <method name="finishSaveSession">
<arg name="name" type="s" direction="in" /> <arg name="name" type="s" direction="in" />
</method> </method>
<!-- Shutdown kwin at the end of the session -->
<method name="quit">
</method>
</interface> </interface>
</node> </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_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 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.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}) add_executable(plasma-shutdown ${plasma_shutdown_SRCS})

@ -9,6 +9,7 @@
#include "sessionmanagementbackend.h" #include "sessionmanagementbackend.h"
#include "ksmserver_interface.h" #include "ksmserver_interface.h"
#include "kwin_interface.h"
#include "debug.h" #include "debug.h"
@ -66,6 +67,12 @@ void Shutdown::logoutCancelled()
void Shutdown::logoutComplete() { void Shutdown::logoutComplete() {
runShutdownScripts(); 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) { if (m_shutdownType == KWorkSpace::ShutdownTypeHalt) {
SessionBackend::self()->shutdown(); SessionBackend::self()->shutdown();
} else if (m_shutdownType == KWorkSpace::ShutdownTypeReboot) { } else if (m_shutdownType == KWorkSpace::ShutdownTypeReboot) {

Loading…
Cancel
Save