diff --git a/top/top.c b/top/top.c index 1e1d749d..296a63c9 100644 --- a/top/top.c +++ b/top/top.c @@ -3615,6 +3615,20 @@ static void win_names (WIN_t *q, const char *name) { } // end: win_names + /* + * This guy just resets (normalizes) a single window + * and he ensures pid monitoring is no longer active. */ +static void win_reset (WIN_t *q) { + SETw(q, Show_IDLEPS | Show_TASKON); +#ifndef SCROLLVAR_NO + q->rc.maxtasks = q->usrseltyp = q->begpflg = q->begtask = q->varcolbeg = 0; +#else + q->rc.maxtasks = q->usrseltyp = q->begpflg = q->begtask = 0; +#endif + Monpidsidx = 0; +} // end: win_reset + + /* * Display a window/field group (ie. make it "current"). */ static WIN_t *win_select (int ch) { @@ -3791,15 +3805,9 @@ static void wins_reflag (int what, int flg) { } /* a flag with special significance -- user wants to rebalance display so we gotta' off some stuff then force on two flags... */ - if (EQUWINS_xxx == flg) { -#ifndef SCROLLVAR_NO - w->rc.maxtasks = w->usrseltyp = w->begpflg = w->begtask = w->varcolbeg = 0; -#else - w->rc.maxtasks = w->usrseltyp = w->begpflg = w->begtask = 0; -#endif - Monpidsidx = 0; - SETw(w, Show_IDLEPS | Show_TASKON); - } + if (EQUWINS_xxx == flg) + win_reset(w); + w = w->next; } while (w != Curwin); } // end: wins_reflag @@ -4325,13 +4333,7 @@ static void keys_window (int ch) { if (ALTCHKw) TOGw(w, Show_TASKON); break; case '=': - SETw(w, Show_IDLEPS | Show_TASKON); -#ifndef SCROLLVAR_NO - w->rc.maxtasks = w->usrseltyp = w->begpflg = w->begtask = w->varcolbeg = 0; -#else - w->rc.maxtasks = w->usrseltyp = w->begpflg = w->begtask = 0; -#endif - Monpidsidx = 0; + win_reset(w); break; case '_': if (ALTCHKw) wins_reflag(Flags_TOG, Show_TASKON); diff --git a/top/top.h b/top/top.h index ca88e8bb..97169c08 100644 --- a/top/top.h +++ b/top/top.h @@ -701,6 +701,7 @@ typedef struct WIN_t { //atic void whack_terminal (void); /*------ Windows/Field Groups support ----------------------------------*/ //atic void win_names (WIN_t *q, const char *name); +//atic void win_reset (WIN_t *q); //atic WIN_t *win_select (int ch); //atic int win_warn (int what); //atic void wins_clrhlp (WIN_t *q, int save);