Code

screen: force repaint progress window in screen_paint()
authorMax Kellermann <max@duempel.org>
Sun, 4 Oct 2009 15:51:46 +0000 (17:51 +0200)
committerMax Kellermann <max@duempel.org>
Sun, 4 Oct 2009 15:51:46 +0000 (17:51 +0200)
src/screen.c

index 19441707f0329c6d958ef21af55075db9ef50ad3..c01c79232571d2de8c37ad2492ef5d810e6382cc 100644 (file)
@@ -154,7 +154,7 @@ paint_top_window(const char *header, const struct mpdclient *c)
 }
 
 static void
-paint_progress_window(struct mpdclient *c)
+update_progress_window(struct mpdclient *c, bool repaint)
 {
        unsigned elapsed, duration;
 
@@ -171,7 +171,8 @@ paint_progress_window(struct mpdclient *c)
                ? mpd_status_get_total_time(c->status)
                : 0;
 
-       if (progress_bar_set(&screen.progress_bar, elapsed, duration))
+       if (progress_bar_set(&screen.progress_bar, elapsed, duration) ||
+           repaint)
                progress_bar_paint(&screen.progress_bar);
 }
 
@@ -342,7 +343,7 @@ screen_paint(struct mpdclient *c)
 
        /* paint the bottom window */
 
-       paint_progress_window(c);
+       update_progress_window(c, true);
        status_bar_paint(&screen.status_bar, c->status, c->song);
 
        /* paint the main window */
@@ -440,7 +441,7 @@ screen_update(struct mpdclient *c)
                paint_top_window("", c);
 
        /* update progress window */
-       paint_progress_window(c);
+       update_progress_window(c, false);
 
        /* update status window */
        status_bar_paint(&screen.status_bar, c->status, c->song);