From 7ccca92c3e4ae0001a143e256956c97dfb3d50a7 Mon Sep 17 00:00:00 2001 From: Oleg Chernovskiy Date: Sat, 30 Jan 2016 14:31:28 +0300 Subject: [PATCH] Remove crash handling in kwin_wayland This patch introduces additional method to Application class that has default policy of restarting the app. This method is overridden for wayland case disabling this step. REVIEW: 126655 --- main.cpp | 7 ++++++- main.h | 1 + main_wayland.cpp | 6 ++++++ main_wayland.h | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 46628c73da..9046e46d48 100644 --- a/main.cpp +++ b/main.cpp @@ -211,9 +211,14 @@ void Application::destroyAtoms() atoms = nullptr; } -void Application::crashChecking() +void Application::setupCrashHandler() { KCrash::setEmergencySaveFunction(Application::crashHandler); +} + +void Application::crashChecking() +{ + setupCrashHandler(); if (crashes >= 4) { // Something has gone seriously wrong AlternativeWMDialog dialog; diff --git a/main.h b/main.h index b9d30f88fc..1822afce60 100644 --- a/main.h +++ b/main.h @@ -177,6 +177,7 @@ Q_SIGNALS: protected: Application(OperationMode mode, int &argc, char **argv); virtual void performStartup() = 0; + virtual void setupCrashHandler(); void notifyKSplash(); void createInput(); diff --git a/main_wayland.cpp b/main_wayland.cpp index 28a5e83c0b..c9ee426150 100644 --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -122,6 +122,12 @@ void ApplicationWayland::performStartup() createBackend(); } +void ApplicationWayland::setupCrashHandler() +{ + // this disables auto-restart of kwin_wayland + // do nothing hence allowing OS to create dump and so on +} + void ApplicationWayland::createBackend() { AbstractBackend *backend = waylandServer()->backend(); diff --git a/main_wayland.h b/main_wayland.h index c7f67410f5..b3a63fc8ff 100644 --- a/main_wayland.h +++ b/main_wayland.h @@ -56,6 +56,7 @@ public: protected: void performStartup() override; + void setupCrashHandler() override; private: void createBackend();