Commit 01fca3e7563a45b33cd6ffa4c89609810c57240f

Con Kolivas 2013-05-19T21:28:53

Create a logwin_update function which mandatorily updates the logwin and use it when input is expected to prevent display refresh delays.

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);