Code

screen: don't call wrefresh() in methods paint() and update()
authorMax Kellermann <max@duempel.org>
Thu, 25 Sep 2008 15:40:36 +0000 (17:40 +0200)
committerMax Kellermann <max@duempel.org>
Thu, 25 Sep 2008 15:40:36 +0000 (17:40 +0200)
screen_paint() and screen_update() are responsible for refreshing the
screen.  We can remove all wrefresh() and wnoutrefresh() invocations
from all paint() and update() method implementations.

src/screen_artist.c
src/screen_file.c
src/screen_help.c
src/screen_keydef.c
src/screen_lyrics.c
src/screen_play.c
src/screen_search.c

index bf7e54df09034017c87a13dbb68becbed8185d6b..6857b66adb712e2cbe94eaa5fcdde9a614dff59a 100644 (file)
@@ -223,8 +223,6 @@ paint(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c)
                wmove(browser.lw->w, 0, 0);
                wclrtobot(browser.lw->w);
        }
-
-       wnoutrefresh(browser.lw->w);
 }
 
 static void
index 8f9c6c89724d142e65755b73f057baacb2dca68d..a3bf192d92fd3a75324e7a17e04966393fe1d8fa 100644 (file)
@@ -178,7 +178,6 @@ static void
 browse_paint(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c)
 {
        list_window_paint(browser.lw, browser_lw_callback, browser.filelist);
-       wnoutrefresh(browser.lw->w);
 }
 
 static void
@@ -191,7 +190,6 @@ browse_update(screen_t *screen, mpdclient_t *c)
        }
 
        list_window_paint(browser.lw, browser_lw_callback, browser.filelist);
-       wnoutrefresh(browser.lw->w);
 }
 
 static int
index eec76d18ad62088db76339efeed5472950cef0b4..cbdd66c62fbacec3c0a6dbcc6196e212b25b8bf0 100644 (file)
@@ -211,7 +211,6 @@ static void
 help_paint(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c)
 {
        list_window_paint(lw, list_callback, NULL);
-       wrefresh(lw->w);
 }
 
 static int
index 38ba315c33099993b9f6de34ac012f84cd177bc1..f6ae3d3e950562fc5f645d0067d9ea533e4ea2ef 100644 (file)
@@ -281,7 +281,6 @@ static void
 keydef_paint(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c)
 {
        list_window_paint(lw, list_callback, NULL);
-       wrefresh(lw->w);
 }
 
 static void
@@ -289,7 +288,6 @@ keydef_update(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c)
 {
        if (lw->repaint) {
                list_window_paint(lw, list_callback, NULL);
-               wrefresh(lw->w);
                lw->repaint = 0;
        }
 }
index 15258009274cffdcaff845c92c637dac658fc61a..50f41b7f6f4c83c0a27d72efbe5bb7d839b0e9dd 100644 (file)
@@ -169,8 +169,6 @@ screen_lyrics_load(struct mpd_song *song)
                                     screen_lyrics_callback, NULL);
 }
 
-static void lyrics_paint(screen_t *screen, mpdclient_t *c);
-
 static FILE *create_lyr_file(const char *artist, const char *title)
 {
        char path[1024];
@@ -265,7 +263,6 @@ static void
 lyrics_paint(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c)
 {
        list_window_paint(lw, list_callback, NULL);
-       wrefresh(lw->w);
 }
 
 
@@ -274,7 +271,6 @@ lyrics_update(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c)
 {
        if( lw->repaint ) {
                list_window_paint(lw, list_callback, NULL);
-               wrefresh(lw->w);
                lw->repaint = 0;
        }
 }
@@ -302,6 +298,7 @@ lyrics_cmd(screen_t *screen, mpdclient_t *c, command_t cmd)
                if (c->song != NULL) {
                        screen_lyrics_load(c->song);
                        lyrics_paint(NULL, NULL);
+                       wrefresh(lw->w);
                }
                return 1;
        default:
index 579d4f4ca98de25062ac9c37e4c187f96bca12d5..6eac958b6efc36e015cf8b0f5c991063c33fb1b4 100644 (file)
@@ -362,7 +362,6 @@ static void
 play_paint(mpd_unused screen_t *screen, mpdclient_t *c)
 {
        list_window_paint(lw, list_callback, (void *) c);
-       wnoutrefresh(lw->w);
 }
 
 static void
@@ -393,7 +392,6 @@ play_update(screen_t *screen, mpdclient_t *c)
                playlist_id = c->playlist.id;
        } else {
                list_window_paint(lw, list_callback, (void *) c);
-               wnoutrefresh(lw->w);
        }
 }
 
index 5995b79765a2acffc732b93605ec26ee3eb015c3..723409028565cde135932103b93b55f3c44d0d3f 100644 (file)
@@ -401,8 +401,6 @@ paint(mpd_unused screen_t *screen, mpdclient_t *c)
                //      wmove(lw->w, 0, 0);
                //wclrtobot(lw->w);
        }
-
-       wnoutrefresh(browser.lw->w);
 }
 
 static void
@@ -414,7 +412,6 @@ update(screen_t *screen, mpdclient_t *c)
        }
 
        list_window_paint(browser.lw, browser_lw_callback, browser.filelist);
-       wnoutrefresh(browser.lw->w);
 }
 
 static const char *