From 9dff41f8e260ebf532fc9e8e32ba1b1d7d142d9c Mon Sep 17 00:00:00 2001 From: Kalle Wallin Date: Tue, 13 Apr 2004 18:36:44 +0000 Subject: [PATCH] Use wclrtoeol instead of wclear in list_window_paint (wclear is slow). git-svn-id: https://svn.musicpd.org/ncmpc/trunk@732 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- list_window.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/list_window.c b/list_window.c index 334f7f6..c086fca 100644 --- a/list_window.c +++ b/list_window.c @@ -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; irows; 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; } -- 2.30.2