diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2020-12-17 19:08:56 -0300 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2020-12-19 16:02:34 +0100 |
commit | e8c6994f40c9c69089e9f80abb2f895d2e077c7e (patch) | |
tree | 7e5078da157f8efba1b3d3b82c95fed6c3276f9c /Process.c | |
parent | 3d1703f16faf5bd3c73976909e1b6e03061a7f72 (diff) |
Add "Tree view is always sorted by PID" option to mimic htop 2 behavior
Diffstat (limited to 'Process.c')
-rw-r--r-- | Process.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -505,7 +505,12 @@ long Process_compare(const void* v1, const void* v2) { p1 = (const Process*)v2; } - switch (settings->sortKey) { + ProcessField key = settings->sortKey; + if (settings->treeView && settings->treeViewAlwaysByPID) { + key = PID; + } + + switch (key) { case PERCENT_CPU: case PERCENT_NORM_CPU: return SPACESHIP_NUMBER(p2->percent_cpu, p1->percent_cpu); |