Handle processId being 0 in ShellClient::killWindow

Summary:
If ClientConnection fails to get the process id (which happens at least
on FreeBSD) the process id is 0. We should not try to terminate this pid
as it terminates all processes is KWin's process group which is the whole
session.

Test Plan: Only compile test

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7168
This commit is contained in:
Martin Flöser 2017-08-06 20:56:13 +02:00
parent 004a9aa6ea
commit 00281711d9

View file

@ -1477,7 +1477,7 @@ void ShellClient::killWindow()
return;
}
auto c = surface()->client();
if (c->processId() == getpid()) {
if (c->processId() == getpid() || c->processId() == 0) {
c->destroy();
return;
}