Configureable timout for applications to close their windows.

Fix 5sec stall when switching from an application to be stopped to an application that was stopped before.
Make Xinstance thread safe
This commit is contained in:
2020-07-01 19:21:27 +02:00
parent 189766f68e
commit 21d5c9475b
5 changed files with 120 additions and 47 deletions

View File

@ -42,11 +42,14 @@ pid_t Process::getPid()
void Process::stop(bool children)
{
kill(pid_, SIGSTOP);
if(children)
if(pid_ > 0)
{
std::vector<Process> children = getChildren();
for(auto& child : children) child.stop(true);
kill(pid_, SIGSTOP);
if(children)
{
std::vector<Process> children = getChildren();
for(auto& child : children) child.stop(true);
}
}
}