From b1b6769b6f040f077544d7884ca5a7c4fbb7af27 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Sun, 10 Jan 2021 17:53:08 -0600 Subject: [PATCH] ProcessController: Fix static scaling mode after hrev54874 * We saw a "big" cpu bar on 1 core. * This was because adding 8 to the static "15" width resulted in the static CPU sizing code getting disabled * Converting this to 4 just completely disabled the static scaling code and made dynamic always enabled Change-Id: Ida8c718c0d0a2fcf72aedbf525daad040d5b3678 --- src/apps/processcontroller/PCWindow.cpp | 16 +++++++++------- src/apps/processcontroller/ProcessController.cpp | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/apps/processcontroller/PCWindow.cpp b/src/apps/processcontroller/PCWindow.cpp index e66766abea..6bcde64612 100644 --- a/src/apps/processcontroller/PCWindow.cpp +++ b/src/apps/processcontroller/PCWindow.cpp @@ -31,14 +31,16 @@ PCWindow::PCWindow() system_info info; get_system_info(&info); - int width = 4; - if (info.cpu_count > 4) - width = info.cpu_count; - if (info.cpu_count <= 16) - width *= 2; - // For the memory bar - width += 8; + int width = 15; + // Over 4 cpus, flip to "dynamic size mode" + if (info.cpu_count > 4) { + width = info.cpu_count; + // For the memory bar + width += 4; + if (info.cpu_count <= 16) + width *= 2; + } BRect rect = Bounds(); diff --git a/src/apps/processcontroller/ProcessController.cpp b/src/apps/processcontroller/ProcessController.cpp index 36e79581b5..11b9ef88bb 100644 --- a/src/apps/processcontroller/ProcessController.cpp +++ b/src/apps/processcontroller/ProcessController.cpp @@ -130,14 +130,16 @@ instantiate_deskbar_item(float maxWidth, float maxHeight) system_info info; get_system_info(&info); - int width = 4; - if (info.cpu_count > 4) - width = info.cpu_count; - if (info.cpu_count <= 16) - width *= 2; - // For the memory bar - width += 8; + int width = 15; + // Over 4 cpus, flip to "dynamic size mode" + if (info.cpu_count > 4) { + width = info.cpu_count; + // For the memory bar + width += 4; + if (info.cpu_count <= 16) + width *= 2; + } // Damn, you got a lot of CPU if (width > maxWidth)