Code

Use wclrtoeol instead of wclear in list_window_paint (wclear is slow).
authorKalle Wallin <kaw@linux.se>
Tue, 13 Apr 2004 18:36:44 +0000 (18:36 +0000)
committerKalle Wallin <kaw@linux.se>
Tue, 13 Apr 2004 18:36:44 +0000 (18:36 +0000)
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@732 09075e82-0dd4-0310-85a5-a0d7c8717e4f

list_window.c

index 334f7f6eb5dbfd6bba30bf01d800518d19d6a794..c086fca5782ef4807a808888f75b0ce788f39916 100644 (file)
@@ -129,11 +129,6 @@ list_window_paint(list_window_t *lw,
       lw->start++;
       lw->clear=1;
     }
-  if( lw->clear )
-    {
-      wclear(lw->w);
-      lw->clear=0;
-    }
 
   for(i=0; i<lw->rows; i++)
     {
@@ -141,15 +136,17 @@ list_window_paint(list_window_t *lw,
       char *label;
 
       label = (callback) (lw->start+i, &highlight, callback_data);
+      wmove(lw->w, i, 0);
+      if( lw->clear )
+       wclrtoeol(lw->w);
       if( label )
        {
-         wmove(lw->w, i, 0);
          if( highlight )
            wattron(lw->w, A_BOLD);
          if( lw->start+i == lw->selected )
            wattron(lw->w, A_REVERSE);
          
-         waddnstr(lw->w, label, lw->cols);
+         waddnstr(lw->w, label, lw->cols-1);
 
          if( highlight )
            wattroff(lw->w, A_BOLD);
@@ -157,6 +154,7 @@ list_window_paint(list_window_t *lw,
            wattroff(lw->w, A_REVERSE);
        }
     }
+  lw->clear=0;
 }