File force-restart-on-crash.patch of Package kwin5.openSUSE_Leap_42.1_Update
From: Thomas Lübking <thomas.luebking@gmail.com>
Date: Wed, 16 Dec 2015 15:30:06 +0000
Subject: force restart on crash
X-Git-Tag: v5.5.95
X-Git-Url: http://quickgit.kde.org/?p=kwin.git&a=commitdiff&h=69aa80750f8d61a5db6311c33751461041a260d5
---
force restart on crash
We don't want to actively release claims on segfaults, but then
drkonqi can stop us while we're still holding the WM privs.
=> If KWin performs a crash-restart, it forcefully takes WM privs
(since the old instance shall be replaced for quite sure)
BUG: 348834
BUG: 353030
BUG: 353428
REVIEW: 126741
FIXED-IN: 5.6
---
--- a/main_x11.cpp
+++ b/main_x11.cpp
@@ -173,7 +173,8 @@
                                                                                                                  maskValues)));
         if (!redirectCheck.isNull()) {
             fputs(i18n("kwin: another window manager is running (try using --replace)\n").toLocal8Bit().constData(), stderr);
-            ::exit(1);
+            if (!wasCrash()) // if this is a crash-restart, DrKonqi may have stopped the process w/o killing the connection
+                ::exit(1);
         }
 
         createInput();
@@ -185,7 +186,7 @@
     });
     // we need to do an XSync here, otherwise the QPA might crash us later on
     Xcb::sync();
-    owner->claim(m_replace, true);
+    owner->claim(m_replace || wasCrash(), true);
 
     createAtoms();
 }