summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 93a8274)
raw | patch | inline | side by side (parent: 93a8274)
author | Max Kellermann <max@duempel.org> | |
Fri, 26 Sep 2008 06:48:31 +0000 (08:48 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Fri, 26 Sep 2008 06:48:31 +0000 (08:48 +0200) |
The play_update() function was reduced too much: it didn't repaint the
screen when the current song changed. Add check for that.
Don't repaint the screen in center_playing_item(), make the caller do
it.
screen when the current song changed. Add check for that.
Don't repaint the screen in center_playing_item(), make the caller do
it.
src/screen_play.c | patch | blob | history |
diff --git a/src/screen_play.c b/src/screen_play.c
index 555412905d8e83c10459effe2d00826dcaa02f90..4ee131c70cfa09edb33a55b0f7872aefab4c4ae0 100644 (file)
--- a/src/screen_play.c
+++ b/src/screen_play.c
/* make sure the cursor is in the window */
lw->selected = lw->start+offset;
list_window_check_selected(lw, length);
-
- playlist_repaint(c);
}
static void
static void
play_update(mpdclient_t *c)
{
- /* center the cursor */
- if (options.auto_center) {
- static int prev_song_id = 0;
+ static int prev_song_id;
+ int current_song_id = c->song != NULL ? c->song->id : 0;
- if (c->song && prev_song_id != c->song->id) {
+ if (current_song_id != prev_song_id) {
+ prev_song_id = current_song_id;
+
+ /* center the cursor */
+ if (options.auto_center && current_song_id != 0)
center_playing_item(c);
- prev_song_id = c->song->id;
- }
+
+ playlist_repaint(c);
}
}
return 1;
case CMD_SCREEN_UPDATE:
center_playing_item(c);
+ playlist_repaint(c);
return 0;
case CMD_LIST_MOVE_UP: