about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-10-06 02:17:45 +0100
committerJames Booth <boothj5@gmail.com>2013-10-06 02:17:45 +0100
commit3cc080b06acc2e2e35bbdad6dedcac008b46ee02 (patch)
treeb26f9a03cc16b0cddf7f951435b12b149341dbad
parent39fa13358020711db0dc6d5a00d41ac0c0c89db6 (diff)
downloadprofani-tty-3cc080b06acc2e2e35bbdad6dedcac008b46ee02.tar.gz
Remove implicit refresh from ProfWin->print_line
-rw-r--r--src/ui/core.c1
-rw-r--r--src/ui/window.c4
-rw-r--r--src/ui/window.h2
3 files changed, 4 insertions, 3 deletions
diff --git a/src/ui/core.c b/src/ui/core.c
index 332960fd..2249a944 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -826,6 +826,7 @@ ui_current_print_line(const char * const msg, ...)
     va_start(arg, msg);
     current->print_line(current, msg, arg);
     va_end(arg);
+    current->refresh_win(current);
 }
 
 void
diff --git a/src/ui/window.c b/src/ui/window.c
index 6683e9c7..13956b22 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -61,7 +61,7 @@ win_create(const char * const title, int cols, win_type_t type)
 
     new_win->print_time = _win_print_time;
     new_win->print_line = _win_print_line;
-    new_win->refresh = _win_refresh;
+    new_win->refresh_win = _win_refresh;
     new_win->presence_colour_on = _win_presence_colour_on;
     new_win->presence_colour_off = _win_presence_colour_off;
     new_win->show_contact = _win_show_contact;
@@ -113,7 +113,6 @@ _win_print_line(ProfWin *self, const char * const msg, ...)
     wprintw(self->win, "%s\n", fmt_msg->str);
     g_string_free(fmt_msg, TRUE);
     va_end(arg);
-    _win_refresh(self);
 }
 
 static void
@@ -215,6 +214,7 @@ _muc_handle_error_message(ProfWin *self, const char * const from,
     gboolean handled = FALSE;
     if (g_strcmp0(err_msg, "conflict") == 0) {
         _win_print_line(self, "Nickname already in use.");
+        _win_refresh(self);
         handled = TRUE;
     }
 
diff --git a/src/ui/window.h b/src/ui/window.h
index 06b5cf97..2eec3b01 100644
--- a/src/ui/window.h
+++ b/src/ui/window.h
@@ -54,7 +54,7 @@ typedef struct prof_win_t {
     int history_shown;
     void (*print_time)(struct prof_win_t *self, char show_char);
     void (*print_line)(struct prof_win_t *self, const char * const msg, ...);
-    void (*refresh)(struct prof_win_t *self);
+    void (*refresh_win)(struct prof_win_t *self);
     void (*presence_colour_on)(struct prof_win_t *self, const char * const presence);
     void (*presence_colour_off)(struct prof_win_t *self, const char * const presence);
     void (*show_contact)(struct prof_win_t *self, PContact contact);