summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorMacDue <macdue@dueutil.tech>2022-05-28 18:01:22 +0100
committerAndreas Kling <kling@serenityos.org>2022-05-28 21:52:44 +0200
commit623ad4a42adf67085bd162509176e38320b859ec (patch)
tree9b6336a23cec44f6e88d9e85713e1c9f486126f6 /Userland
parent39682d4fbc26db3a721f52777ea5f8e41d591db9 (diff)
downloadserenity-623ad4a42adf67085bd162509176e38320b859ec.zip
Applets/ResourceGraph: Open network monitor when clicking network graph
(Previously, it would open the performance monitor tab)
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Applets/ResourceGraph/main.cpp10
1 files 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 <LibGUI/Application.h>
#include <LibGUI/Frame.h>
#include <LibGUI/Painter.h>
+#include <LibGUI/Process.h>
#include <LibGUI/Window.h>
#include <LibGfx/Palette.h>
#include <LibMain/Main.h>
@@ -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<char**>(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)