From a26143e3a68bc137d0d8c922a0b7fa16461c1755 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Fri, 5 Feb 2021 08:49:58 +0100 Subject: Add patches for sort timeout and initial CPU meter setup, release 3.0.5-4 --- debian/changelog | 7 ++-- debian/patches/0010-fix-sort-timeout.patch | 25 ++++++++++++ .../0011-improve-setup-for-many-cpu-systems.patch | 47 ++++++++++++++++++++++ debian/patches/series | 2 + 4 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 debian/patches/0010-fix-sort-timeout.patch create mode 100644 debian/patches/0011-improve-setup-for-many-cpu-systems.patch diff --git a/debian/changelog b/debian/changelog index 503f04c..b0946b4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,11 @@ -htop (3.0.5-4) UNRELEASED; urgency=medium +htop (3.0.5-4) unstable; urgency=medium * Fix mouse use / scrolling in Infoscreens * Fix Shift-F3 (prev hit in search mode) for QT based terminals - * Harden string handling routine + * Harden string handling routine, sort timeout + * Improve initial setup of CPU meters for systems with many cores - -- Daniel Lange Tue, 02 Feb 2021 06:45:00 +0100 + -- Daniel Lange Fri, 05 Feb 2021 08:50:00 +0100 htop (3.0.5-3) unstable; urgency=medium diff --git a/debian/patches/0010-fix-sort-timeout.patch b/debian/patches/0010-fix-sort-timeout.patch new file mode 100644 index 0000000..0822589 --- /dev/null +++ b/debian/patches/0010-fix-sort-timeout.patch @@ -0,0 +1,25 @@ +From 12f5f06e8855b653c98b75de55a45098bb468d57 Mon Sep 17 00:00:00 2001 +From: Daniel Lange +Date: Mon, 1 Feb 2021 16:02:31 +0100 +Subject: [PATCH] Check for sortTimeout to not run towards -inf + +Seems to happen on Mac OS "Big Sur" (~forced application sleep) +Partial fix for #510 +--- + ScreenManager.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/ScreenManager.c b/ScreenManager.c +index 64af535b..df5fed4f 100644 +--- a/ScreenManager.c ++++ b/ScreenManager.c +@@ -202,7 +202,8 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) { + } + } + if (ch == ERR) { +- sortTimeout--; ++ if (sortTimeout > 0) ++ sortTimeout--; + if (prevCh == ch && !timedOut) { + closeTimeout++; + if (closeTimeout == 100) { diff --git a/debian/patches/0011-improve-setup-for-many-cpu-systems.patch b/debian/patches/0011-improve-setup-for-many-cpu-systems.patch new file mode 100644 index 0000000..bae69f5 --- /dev/null +++ b/debian/patches/0011-improve-setup-for-many-cpu-systems.patch @@ -0,0 +1,47 @@ +From 8fb51627b2e116d7957f57f27aff31ea726d7d86 Mon Sep 17 00:00:00 2001 +From: Daniel Lange +Date: Tue, 2 Feb 2021 10:32:11 +0100 +Subject: [PATCH] Improve initial setup for systems with many CPUs + +Resolves #435 +--- + Settings.c | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +diff --git a/Settings.c b/Settings.c +index 6c8f8894..f12a51f4 100644 +--- a/Settings.c ++++ b/Settings.c +@@ -55,7 +55,7 @@ static void Settings_readMeterModes(Settings* this, const char* line, int column + + static void Settings_defaultMeters(Settings* this, int initialCpuCount) { + int sizes[] = { 3, 3 }; +- if (initialCpuCount > 4) { ++ if (initialCpuCount > 4 && initialCpuCount <= 128) { + sizes[1]++; + } + for (int i = 0; i < 2; i++) { +@@ -64,7 +64,22 @@ static void Settings_defaultMeters(Settings* this, int initialCpuCount) { + this->columns[i].len = sizes[i]; + } + int r = 0; +- if (initialCpuCount > 8) { ++ ++ if (initialCpuCount > 128) { ++ // Just show the average, ricers need to config for impressive screenshots ++ this->columns[0].names[0] = xStrdup("CPU"); ++ this->columns[0].modes[0] = BAR_METERMODE; ++ } else if (initialCpuCount > 32) { ++ this->columns[0].names[0] = xStrdup("LeftCPUs8"); ++ this->columns[0].modes[0] = BAR_METERMODE; ++ this->columns[1].names[r] = xStrdup("RightCPUs8"); ++ this->columns[1].modes[r++] = BAR_METERMODE; ++ } else if (initialCpuCount > 16) { ++ this->columns[0].names[0] = xStrdup("LeftCPUs4"); ++ this->columns[0].modes[0] = BAR_METERMODE; ++ this->columns[1].names[r] = xStrdup("RightCPUs4"); ++ this->columns[1].modes[r++] = BAR_METERMODE; ++ } else if (initialCpuCount > 8) { + this->columns[0].names[0] = xStrdup("LeftCPUs2"); + this->columns[0].modes[0] = BAR_METERMODE; + this->columns[1].names[r] = xStrdup("RightCPUs2"); diff --git a/debian/patches/series b/debian/patches/series index f8c651e..400b378 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -7,3 +7,5 @@ 0007-fix-exit-in-signal-handler.patch 0008-add-qterm-keyboard-code.patch 0009-hardening.patch +0010-fix-sort-timeout.patch +0011-improve-setup-for-many-cpu-systems.patch -- cgit v1.2.3