diff options
Diffstat (limited to 'wayland')
-rw-r--r-- | wayland/democompositor/processlauncher.cpp | 11 | ||||
-rw-r--r-- | wayland/democompositor/processlauncher.h | 1 | ||||
-rw-r--r-- | wayland/democompositor/qml/Screen.qml | 2 |
3 files changed, 13 insertions, 1 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; diff --git a/wayland/democompositor/processlauncher.h b/wayland/democompositor/processlauncher.h index 3d30c07..9453368 100644 --- a/wayland/democompositor/processlauncher.h +++ b/wayland/democompositor/processlauncher.h @@ -86,6 +86,7 @@ public: Q_INVOKABLE QVariant appStateForPid(int pid) const; Q_INVOKABLE bool isRunning(const AppEntry& entry) const; + Q_INVOKABLE void kill(const AppEntry& entry); Q_SIGNALS: void appStarted(const AppState &appState); diff --git a/wayland/democompositor/qml/Screen.qml b/wayland/democompositor/qml/Screen.qml index ef3be4d..bea189b 100644 --- a/wayland/democompositor/qml/Screen.qml +++ b/wayland/democompositor/qml/Screen.qml @@ -91,7 +91,7 @@ WaylandOutput { id: apps onAppRemoved: { console.log("Application was removed: " + appEntry.appName); - launcher.stop(appEntry); + launcher.kill(appEntry); } } |