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
This commit is contained in:
Thomas Lübking 2015-12-16 16:30:06 +01:00
parent 57c9aa9fc0
commit 69aa80750f

View file

@ -173,7 +173,8 @@ void ApplicationX11::performStartup()
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 @@ void ApplicationX11::performStartup()
});
// 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();
}