From 75fd9edf755572d26da4c745aefae3eb4bb08445 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Wed, 31 Mar 2021 13:50:16 +1100 Subject: [PATCH] Reorder the header update and process scanning BenBE points out that some header meters use values calculated during process scanning - make sure we scan processes first in order that current values are displayed. Related to https://github.com/htop-dev/htop/pull/574 --- ScreenManager.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ScreenManager.c b/ScreenManager.c index c4fbfeee..17a76bf3 100644 --- a/ScreenManager.c +++ b/ScreenManager.c @@ -105,9 +105,10 @@ static void checkRecalculation(ScreenManager* this, double* oldTime, int* sortTi if (*rescan) { *oldTime = newTime; + // scan processes first - some header values are calculated there + ProcessList_scan(pl, this->state->pauseProcessUpdate); // always update header, especially to avoid gaps in graph meters Header_updateData(this->header); - ProcessList_scan(pl, this->state->pauseProcessUpdate); if (!this->state->pauseProcessUpdate && (*sortTimeout == 0 || this->settings->treeView)) { ProcessList_sort(pl); *sortTimeout = 1;