Create a logwin_update function which mandatorily updates the logwin and use it when input is expected to prevent display refresh delays.
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
diff --git a/cgminer.c b/cgminer.c
index d65647f..f92d878 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2215,6 +2215,14 @@ void clear_logwin(void)
unlock_curses();
}
}
+
+void logwin_update(void)
+{
+ if (curses_active_locked()) {
+ touchwin(logwin);
+ wrefresh(logwin);
+ }
+}
#endif
static void enable_pool(struct pool *pool)
@@ -4115,6 +4123,7 @@ retry:
wlogprint("[A]dd pool [R]emove pool [D]isable pool [E]nable pool\n");
wlogprint("[C]hange management strategy [S]witch pool [I]nformation\n");
wlogprint("Or press any other key to continue\n");
+ logwin_update();
input = getch();
if (!strncasecmp(&input, "a", 1)) {
@@ -4237,6 +4246,7 @@ retry:
opt_compact ? "on" : "off",
opt_log_interval);
wlogprint("Select an option or any other key to return\n");
+ logwin_update();
input = getch();
if (!strncasecmp(&input, "q", 1)) {
opt_quiet ^= true;
@@ -4345,6 +4355,7 @@ retry:
"[W]rite config file\n[C]gminer restart\n",
opt_queue, opt_scantime, opt_expiry);
wlogprint("Select an option or any other key to return\n");
+ logwin_update();
input = getch();
if (!strncasecmp(&input, "q", 1)) {
diff --git a/driver-opencl.c b/driver-opencl.c
index de63b13..d9d9837 100644
--- a/driver-opencl.c
+++ b/driver-opencl.c
@@ -740,6 +740,7 @@ retry:
wlogprint("[E]nable [D]isable [I]ntensity [R]estart GPU %s\n",adl_active ? "[C]hange settings" : "");
wlogprint("Or press any other key to continue\n");
+ logwin_update();
input = getch();
if (nDevs == 1)
diff --git a/miner.h b/miner.h
index 2e6da64..c0771d0 100644
--- a/miner.h
+++ b/miner.h
@@ -1269,6 +1269,7 @@ extern void zero_stats(void);
extern void default_save_file(char *filename);
extern bool log_curses_only(int prio, const char *f, va_list ap);
extern void clear_logwin(void);
+extern void logwin_update(void);
extern bool pool_tclear(struct pool *pool, bool *var);
extern struct thread_q *tq_new(void);
extern void tq_free(struct thread_q *tq);