From a74694f6ff547f797ce4885c65a6f13ca5b139c0 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Fri, 10 Jun 2022 15:50:40 +0100 Subject: [PATCH] [xwl] Restart xwayland regardless of exit value In the case of an assert, for example a wayland error Xwayland will exit, but with an exitStatus of "normal exit". We also trigger a shutdown should kwin encounter an error on the X11 side, this would be a clean exit from an XwaylandLauncher point of view. It makes sense to try to restart. Deliberate shutdown is handled by destroying the XwaylandLauncher. This means it's not an issue for final kwin teardown. --- src/xwayland/xwaylandlauncher.cpp | 14 +------------- src/xwayland/xwaylandlauncher.h | 1 - 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/xwayland/xwaylandlauncher.cpp b/src/xwayland/xwaylandlauncher.cpp index 33f7a69e37..7889d4465e 100644 --- a/src/xwayland/xwaylandlauncher.cpp +++ b/src/xwayland/xwaylandlauncher.cpp @@ -256,20 +256,8 @@ void XwaylandLauncher::maybeDestroyReadyNotifier() void XwaylandLauncher::handleXwaylandFinished(int exitCode, QProcess::ExitStatus exitStatus) { - qCDebug(KWIN_XWL) << "Xwayland process has quit with exit code" << exitCode; + qCDebug(KWIN_XWL) << "Xwayland process has quit with exit status:" << exitStatus << "exit code:" << exitCode; - switch (exitStatus) { - case QProcess::NormalExit: - stop(); - break; - case QProcess::CrashExit: - handleXwaylandCrashed(); - break; - } -} - -void XwaylandLauncher::handleXwaylandCrashed() -{ #if KWIN_BUILD_NOTIFICATIONS KNotification::event(QStringLiteral("xwaylandcrash"), i18n("Xwayland has crashed")); #endif diff --git a/src/xwayland/xwaylandlauncher.h b/src/xwayland/xwaylandlauncher.h index e7c99668f4..79c227b3df 100644 --- a/src/xwayland/xwaylandlauncher.h +++ b/src/xwayland/xwaylandlauncher.h @@ -86,7 +86,6 @@ Q_SIGNALS: private Q_SLOTS: void resetCrashCount(); void handleXwaylandFinished(int exitCode, QProcess::ExitStatus exitStatus); - void handleXwaylandCrashed(); void handleXwaylandError(QProcess::ProcessError error); private: