about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-02-12 22:44:00 +0000
committerJames Booth <boothj5@gmail.com>2012-02-12 22:44:00 +0000
commit632528a9e3244fad9d4e1d31cf278f6c71917126 (patch)
tree922e2784c13fc381093760068f3703c475947f9f
parent02f5df5b20bc589e277c8772aa836ff2bb5e8651 (diff)
downloadprofani-tty-632528a9e3244fad9d4e1d31cf278f6c71917126.tar.gz
Added title bar refresh to main loop
-rw-r--r--profanity.c2
-rw-r--r--title_bar.c8
-rw-r--r--windows.h1
3 files changed, 10 insertions, 1 deletions
diff --git a/profanity.c b/profanity.c
index 61b0c975..b2d8adcb 100644
--- a/profanity.c
+++ b/profanity.c
@@ -18,6 +18,7 @@ void profanity_start(void)
     char cmd[50];
 
     while (cmd_result == AWAIT_COMMAND) {
+        title_bar_refresh();
         status_bar_refresh();
         inp_get_command_str(cmd);
         cmd_result = handle_start_command(cmd);
@@ -52,6 +53,7 @@ static void _profanity_event_loop(int *ch, char *cmd, int *size)
 {
     usleep(1);
 
+    title_bar_refresh();
     status_bar_refresh();
 
     // handle incoming messages
diff --git a/title_bar.c b/title_bar.c
index 27b2855e..17727f77 100644
--- a/title_bar.c
+++ b/title_bar.c
@@ -15,10 +15,16 @@ void create_title_bar(void)
     title_bar_show(title);
 }
 
+void title_bar_refresh(void)
+{
+    touchwin(title_bar);
+    wrefresh(title_bar);
+    inp_put_back();
+}
+
 void title_bar_show(char *title)
 {
     wclear(title_bar);
     mvwprintw(title_bar, 0, 0, " %s", title);
-    wrefresh(title_bar);
 }
 
diff --git a/windows.h b/windows.h
index efc55b03..cd60da6d 100644
--- a/windows.h
+++ b/windows.h
@@ -18,6 +18,7 @@ void create_status_bar(void);
 void create_input_window(void);
 
 // title bar actions
+void title_bar_refresh(void);
 void title_bar_show(char *title);
 
 // main window actions