]> granicus.if.org Git - procps-ng/commitdiff
top: fix a minor startup flaw for the '2 abreast' mode
authorJim Warner <james.warner@comcast.net>
Sun, 31 May 2020 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Thu, 4 Jun 2020 10:19:03 +0000 (20:19 +1000)
This ensures that a single '4' keystroke will reliably
toggle the new 2 abreast mode ON. Depending on whether
an older configuration file existed or whether top was
configured with '--disable-modern-top', keying the '4'
for a second time might otherwise have been necessary.

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c

index 537e7b0e159687e4e577b7416412dabcbfc68072..89c395756816f3b9ebe41b15eeb9affa61117aa1 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -4270,6 +4270,8 @@ static void wins_stage_2 (void) {
       Winstk[i].findlen = 0;
       if (Winstk[i].rc.combine_cpus >= Cpu_cnt)
          Winstk[i].rc.combine_cpus = 0;
+      if (CHKw(&Winstk[i], (View_CPUSUM | View_CPUNOD)))
+         Winstk[i].rc.double_up = 0;
    }
    if (!Batch)
       putp((Cursor_state = Cap_curs_hide));