diff mcabber/src/screen.c @ 724:264375fe7159

Fix a roster refresh issue Calling scr_UpdateChatStatus() after clearing the roster window was causing an unneeded screen update.
author Mikael Berthe <mikael@lilotux.net>
date Sun, 05 Mar 2006 16:54:01 +0100
parents 23068490d063
children 1aff92625bdb
line wrap: on
line diff
--- a/mcabber/src/screen.c	Sun Mar 05 11:00:24 2006 +0100
+++ b/mcabber/src/screen.c	Sun Mar 05 16:54:01 2006 +0100
@@ -532,17 +532,19 @@
 
 //  scr_UpdateMainStatus()
 // Redraw the main (bottom) status line.
-void scr_UpdateMainStatus(void)
+void scr_UpdateMainStatus(int forceupdate)
 {
   const char *sm = jb_getstatusmsg();
 
   werase(mainstatusWnd);
-  mvwprintw(mainstatusWnd, 0, 0, "%c[%c] %s", 
+  mvwprintw(mainstatusWnd, 0, 0, "%c[%c] %s",
             (unread_msg(NULL) ? '#' : ' '),
             imstatus2char[jb_getstatus()], (sm ? sm : ""));
-  top_panel(inputPanel);
-  update_panels();
-  doupdate();
+  if (forceupdate) {
+    top_panel(inputPanel);
+    update_panels();
+    doupdate();
+  }
 }
 
 //  scr_DrawMainWindow()
@@ -734,7 +736,7 @@
 
   // Usually we need to update the bottom status line too,
   // at least to refresh the pending message flag.
-  scr_UpdateMainStatus();
+  scr_UpdateMainStatus(FALSE);
 
   fullname = buddy_getname(BUDDATA(current_buddy));
   btype = buddy_gettype(BUDDATA(current_buddy));
@@ -815,6 +817,11 @@
 
   cursor_backup = curs_set(0);
 
+  if (!buddylist)
+    offset = 0;
+  else
+    scr_UpdateChatStatus(FALSE);
+
   // Cleanup of roster window
   werase(rosterWnd);
 
@@ -825,11 +832,6 @@
       mvwaddch(rosterWnd, i, Roster_Width-1, ACS_VLINE);
   }
 
-  if (!buddylist)
-    offset = 0;
-  else
-    scr_UpdateChatStatus(FALSE);
-
   // Leave now if buddylist is empty or the roster is hidden
   if (!buddylist || !Roster_Width) {
     update_panels();