diff --git a/Userland/Applications/SystemMonitor/ProcessModel.cpp b/Userland/Applications/SystemMonitor/ProcessModel.cpp index ba9b47065f..f5ad6d2382 100644 --- a/Userland/Applications/SystemMonitor/ProcessModel.cpp +++ b/Userland/Applications/SystemMonitor/ProcessModel.cpp @@ -57,6 +57,8 @@ ProcessModel::ProcessModel() if (m_cpus.is_empty()) m_cpus.append(make(0)); + + m_kernel_process_icon = GUI::Icon::default_icon("gear"); } ProcessModel::~ProcessModel() @@ -261,6 +263,8 @@ GUI::Variant ProcessModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol if (role == GUI::ModelRole::Display) { switch (index.column()) { case Column::Icon: { + if (thread.current_state.kernel) + return m_kernel_process_icon; auto icon = GUI::FileIconProvider::icon_for_executable(thread.current_state.executable).bitmap_for_size(16); if (!icon) return GUI::Icon(); @@ -299,6 +303,8 @@ GUI::Variant ProcessModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol case Column::Processor: return thread.current_state.cpu; case Column::Name: + if (thread.current_state.kernel) + return String::formatted("{} (*)", thread.current_state.name); return thread.current_state.name; case Column::Syscalls: return thread.current_state.syscall_count; @@ -348,6 +354,7 @@ void ProcessModel::update() for (auto& it : all_processes.value()) { for (auto& thread : it.value.threads) { ThreadState state; + state.kernel = it.value.kernel; state.pid = it.value.pid; state.user = it.value.username; state.pledge = it.value.pledge; diff --git a/Userland/Applications/SystemMonitor/ProcessModel.h b/Userland/Applications/SystemMonitor/ProcessModel.h index d303eff7a5..a33180b362 100644 --- a/Userland/Applications/SystemMonitor/ProcessModel.h +++ b/Userland/Applications/SystemMonitor/ProcessModel.h @@ -109,6 +109,7 @@ private: pid_t sid; unsigned ticks_user; unsigned ticks_kernel; + bool kernel; String executable; String name; String state; @@ -146,4 +147,5 @@ private: NonnullOwnPtrVector m_cpus; Vector m_tids; RefPtr m_proc_all; + GUI::Icon m_kernel_process_icon; };