From 623ad4a42adf67085bd162509176e38320b859ec Mon Sep 17 00:00:00 2001 From: MacDue Date: Sat, 28 May 2022 18:01:22 +0100 Subject: [PATCH] Applets/ResourceGraph: Open network monitor when clicking network graph (Previously, it would open the performance monitor tab) --- Userland/Applets/ResourceGraph/main.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Userland/Applets/ResourceGraph/main.cpp b/Userland/Applets/ResourceGraph/main.cpp index e63a162cbc..c4b0fe526e 100644 --- a/Userland/Applets/ResourceGraph/main.cpp +++ b/Userland/Applets/ResourceGraph/main.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -141,14 +142,7 @@ private: { if (event.button() != GUI::MouseButton::Primary) return; - pid_t child_pid; - char const* argv[] = { "SystemMonitor", "-t", "graphs", nullptr }; - if ((errno = posix_spawn(&child_pid, "/bin/SystemMonitor", nullptr, nullptr, const_cast(argv), environ))) { - perror("posix_spawn"); - } else { - if (disown(child_pid) < 0) - perror("disown"); - } + GUI::Process::spawn_or_show_error(window(), "/bin/SystemMonitor", Array { "-t", m_graph_type == GraphType::Network ? "network" : "graphs" }); } bool get_cpu_usage(u64& total, u64& idle)