aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/thermal/tmon/tui.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/thermal/tmon/tui.c b/tools/thermal/tmon/tui.c
index 43c5aecf71da..2779573a53cb 100644
--- a/tools/thermal/tmon/tui.c
+++ b/tools/thermal/tmon/tui.c
@@ -274,11 +274,14 @@ const char DIAG_TITLE[] = "[ TUNABLES ]";
274void show_dialogue(void) 274void show_dialogue(void)
275{ 275{
276 int j, x = 0, y = 0; 276 int j, x = 0, y = 0;
277 int rows, cols;
277 WINDOW *w = dialogue_window; 278 WINDOW *w = dialogue_window;
278 279
279 if (tui_disabled || !w) 280 if (tui_disabled || !w)
280 return; 281 return;
281 282
283 getmaxyx(w, rows, cols);
284
282 werase(w); 285 werase(w);
283 box(w, 0, 0); 286 box(w, 0, 0);
284 mvwprintw(w, 0, maxx/4, DIAG_TITLE); 287 mvwprintw(w, 0, maxx/4, DIAG_TITLE);
@@ -297,10 +300,8 @@ void show_dialogue(void)
297 wattron(w, A_BOLD); 300 wattron(w, A_BOLD);
298 mvwprintw(w, DIAG_DEV_ROWS+1, 1, "Enter Choice [A-Z]?"); 301 mvwprintw(w, DIAG_DEV_ROWS+1, 1, "Enter Choice [A-Z]?");
299 wattroff(w, A_BOLD); 302 wattroff(w, A_BOLD);
300 /* y size of dialogue win is nr cdev + 5, so print legend 303 /* print legend at the bottom line */
301 * at the bottom line 304 mvwprintw(w, rows - 2, 1,
302 */
303 mvwprintw(w, ptdata.nr_cooling_dev+3, 1,
304 "Legend: A=Active, P=Passive, C=Critical"); 305 "Legend: A=Active, P=Passive, C=Critical");
305 306
306 wrefresh(dialogue_window); 307 wrefresh(dialogue_window);