diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2017-09-12 12:19:55 +0200 |
---|---|---|
committer | Holger Freyther <holger+qt@freyther.de> | 2017-11-29 02:12:25 +0000 |
commit | f73fdd97d4bf70b02aac4c0b680a51e632f732eb (patch) | |
tree | e4406a5b06d40b8518d4debd4872019782a11681 /wayland/democompositor/processlauncher.cpp | |
parent | 613fb8ce4d5120fc219babe961dbbc71fe5fcd0c (diff) |
democompositor: Allow to stop running processes by AppEntry
Kill all processes that were started with the same AppEntry. It is
using SIGKILL to make sure that the process is going away and going
away quickly.
Change-Id: I4d2bf2cf7fb35c34636640562c04e4bd528bed63
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'wayland/democompositor/processlauncher.cpp')
-rw-r--r-- | wayland/democompositor/processlauncher.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/wayland/democompositor/processlauncher.cpp b/wayland/democompositor/processlauncher.cpp index bd78de6..6147f05 100644 --- a/wayland/democompositor/processlauncher.cpp +++ b/wayland/democompositor/processlauncher.cpp @@ -107,6 +107,17 @@ bool WaylandProcessLauncher::isRunning(const AppEntry& entry) const return false; } +void WaylandProcessLauncher::kill(const AppEntry& entry) +{ + for (auto state : m_appStates) { + if (state.appEntry.sourceFileName != entry.sourceFileName) + continue; + + qCDebug(procs) << "Killing process " << state.process->pid() << " for " << entry.sourceFileName; + state.process->kill(); + } +} + void WaylandProcessLauncher::launch(const AppEntry &entry) { qCDebug(procs) << "Launching" << entry.executableName; |