From bddc9fb3e67cb1cc27752fb64f8dc13a5173c6af Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Tue, 10 Aug 2021 00:00:00 -0500 Subject: [PATCH] top: thread mode transitions should remove focus ('F') The commit referenced below forced a return to row one whenever there was a thread mode transition. Now, with our new focus ('F') feature, we should adopt a similar philosophy so as to avoid potential display anomalies. Reference(s) . Jun 2018, force row 1 w/ thread mode transition commit 9dd7a97c4a6861aa3a6217c8a03fc0d2397b2bef Signed-off-by: Jim Warner --- top/top.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/top/top.c b/top/top.c index 03f0a791..bcd28f78 100644 --- a/top/top.c +++ b/top/top.c @@ -5190,6 +5190,7 @@ static void write_rcfile (void) { static void keys_global (int ch) { WIN_t *w = Curwin; // avoid gcc bloat with a local copy + int i; switch (ch) { case '?': @@ -5229,7 +5230,8 @@ static void keys_global (int ch) { if (!CHKw(w, View_STATES)) show_msg(fmtmk(N_fmt(THREADS_show_fmt) , Thread_mode ? N_txt(ON_word_only_txt) : N_txt(OFF_one_word_txt))); - Winstk[0].begtask = Winstk[1].begtask = Winstk[2].begtask = Winstk[3].begtask = 0; + for (i = 0 ; i < GROUPSMAX; i++) + Winstk[i].begtask = Winstk[i].focus_pid = 0; // force an extra procs refresh to avoid %cpu distortions... Pseudo_row = PROC_XTRA; break;