summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Lisov <dennis.lissov@gmail.com>2022-05-20 23:57:36 +0300
committerDenis Lisov <dennis.lissov@gmail.com>2022-05-30 10:52:12 +0300
commitda97d2625aeb9cad57657ed9cc076b558f30921d (patch)
treea5bf885ec92c99e008a7691e2fc5cf76b08c1525
parentd73cc7056631186d428e342794fe4648f4778cea (diff)
ProcessList_collapseAllBranches: actually build tree
As the loop checks `tree_depth`, a tree build is needed to ensure they're filled in correctly. Note that this breaks the display list sort order in case it's non-tree-based (either startup in flat mode, or `*` hotkey in flat mode), so the display list will need to be sorted again.
-rw-r--r--ProcessList.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ProcessList.c b/ProcessList.c
index f71619f6..2fad32b7 100644
--- a/ProcessList.c
+++ b/ProcessList.c
@@ -353,7 +353,10 @@ void ProcessList_expandTree(ProcessList* this) {
}
}
+// Called on collapse-all toggle and on startup, possibly in non-tree mode
void ProcessList_collapseAllBranches(ProcessList* this) {
+ ProcessList_buildTree(this); // Update `tree_depth` fields of the processes
+ this->needsSort = true; // ProcessList is sorted by parent now, force new sort
int size = Vector_size(this->processes);
for (int i = 0; i < size; i++) {
Process* process = (Process*) Vector_get(this->processes, i);

© 2014-2024 Faster IT GmbH | imprint | privacy policy