From 9349100dd3cff28e6a91e4b77596f55f3b91d140 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Tue, 7 Feb 2012 15:15:15 -0600 Subject: [PATCH] top: reduce use of 'clear_screen' to absolute minimum Along the way to width override support (-w switch), this top began clearing the screen far more often than his predecessor. In fact, it happend with each user keystroke. This commit dramatically reduces those occurances. The screen will now be cleared only when an actual SIGWINCH is received. Thanks for identifying this flaw belongs to: James Cloos, cloos@jhcloos.com References: http://www.freelists.org/post/procps/Merge-request Blame: c2dcbef4826806f85b7ad6de2d9fe99bc390d603 Author: Jim Warner Date: Thu May 26 11:33:32 2011 +0200 subject: added output width/height override support to top, + misc --- top/top.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/top/top.c b/top/top.c index 45835052..2105076e 100644 --- a/top/top.c +++ b/top/top.c @@ -568,7 +568,7 @@ static void sig_paused (int dont_care_sig) { * SIGCONT and SIGWINCH */ static void sig_resize (int dont_care_sig) { (void)dont_care_sig; - Frames_resize = 1; + Frames_resize = 2; } // end: sig_resize /*###### Misc Color/Display support ####################################*/ @@ -1357,7 +1357,7 @@ static void adj_geometry (void) { Pseudo_screen = alloc_r(Pseudo_screen, pseudo_max); } PSU_CLREOS(0); - if (Frames_resize) putp(Cap_clr_scr); + if (Frames_resize > 1) putp(Cap_clr_scr); } // end: adj_geometry