Consolidate all screen updates to the watchdog thread and touch both windows before refresh.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
diff --git a/cgminer.c b/cgminer.c
index 1e58431..b1aaebc 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -1198,8 +1198,6 @@ static void curses_print_status(void)
mvwhline(statuswin, logstart - 1, 0, '-', 80);
mvwprintw(statuswin, devcursor - 1, 1, "[P]ool management %s[S]ettings [D]isplay options [Q]uit",
have_opencl ? "[G]PU management " : "");
- /* The window will be updated once we're done with all the devices */
- wnoutrefresh(statuswin);
}
static void adj_width(int var, int *length)
@@ -1248,7 +1246,6 @@ static void curses_print_devstatus(int thr_id)
}
wclrtoeol(statuswin);
- wnoutrefresh(statuswin);
}
static void print_status(int thr_id)
@@ -1286,7 +1283,6 @@ static void check_winsizes(void)
y -= logcursor;
wresize(logwin, y, x);
mvwin(logwin, logcursor, 0);
- doupdate();
unlock_curses();
}
}
@@ -1310,7 +1306,6 @@ void wlogprint(const char *f, ...)
va_start(ap, f);
vw_printw(logwin, f, ap);
va_end(ap);
- wrefresh(logwin);
unlock_curses();
}
}
@@ -1327,7 +1322,10 @@ void log_curses(int prio, const char *f, va_list ap)
if (curses_active_locked()) {
if (!opt_loginput || high_prio) {
vw_printw(logwin, f, ap);
- wrefresh(logwin);
+ if (high_prio) {
+ touchwin(logwin);
+ wrefresh(logwin);
+ }
}
unlock_curses();
} else
@@ -1338,7 +1336,6 @@ void clear_logwin(void)
{
if (curses_active_locked()) {
wclear(logwin);
- wrefresh(logwin);
unlock_curses();
}
}
@@ -2247,7 +2244,6 @@ static void display_pool_summary(struct pool *pool)
wlog(" Stale submissions discarded due to new blocks: %d\n", pool->stale_shares);
wlog(" Unable to get work from server occasions: %d\n", pool->getfail_occasions);
wlog(" Submitting work remotely delay occasions: %d\n\n", pool->remotefail_occasions);
- wrefresh(logwin);
unlock_curses();
}
}
@@ -3687,8 +3683,10 @@ static void *watchdog_thread(void __maybe_unused *userdata)
curses_print_status();
for (i = 0; i < mining_threads; i++)
curses_print_devstatus(i);
- clearok(curscr, true);
- doupdate();
+ touchwin(statuswin);
+ wrefresh(statuswin);
+ touchwin(logwin);
+ wrefresh(logwin);
unlock_curses();
}