]> granicus.if.org Git - procps-ng/commitdiff
top: tweaks to vertical scroll management & 'i' toggle
authorJim Warner <james.warner@comcast.net>
Wed, 10 Feb 2016 06:00:00 +0000 (00:00 -0600)
committerCraig Small <csmall@enc.com.au>
Sat, 12 Mar 2016 03:54:05 +0000 (14:54 +1100)
The commit referenced below claims to disable vertical
scrolling when idle tasks weren't being shown. However
it really addresses only a point in time when that 'i'
toggle is keyed. Left untouched were the up/down keys.

So this commit will simply finish the job of disabling
vertical scrolling whenever tasks which have used some
CPU are the only ones which are currently being shown.

Reference(s):
commit c07f6c5e6d6170ef3f2373b4d86988184c3235bf

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

index d0ce0ecd20dacd17d58d7d831ddfe8817dddc675..d649e4b7f85a6742e22121dd1b6b0c40f1a0aa7a 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -4369,10 +4369,10 @@ static void keys_window (int ch) {
          }
          break;
       case kbd_UP:
-         if (VIZCHKw(w)) if (0 < w->begtask) w->begtask -= 1;
+         if (VIZCHKw(w)) if (CHKw(w, Show_IDLEPS) && 0 < w->begtask) w->begtask -= 1;
          break;
       case kbd_DOWN:
-         if (VIZCHKw(w)) if (w->begtask < PIDSmaxt -1) w->begtask += 1;
+         if (VIZCHKw(w)) if (CHKw(w, Show_IDLEPS) && (w->begtask < PIDSmaxt -1)) w->begtask += 1;
          break;
 #ifdef USE_X_COLHDR // ------------------------------------
       case kbd_LEFT: