summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 83b8db0)
raw | patch | inline | side by side (parent: 83b8db0)
author | Max Kellermann <max@duempel.org> | |
Sat, 17 Oct 2009 22:55:26 +0000 (00:55 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sat, 17 Oct 2009 22:55:26 +0000 (00:55 +0200) |
This allows us to use screen_queue_selected_song().
src/screen_queue.c | patch | blob | history |
diff --git a/src/screen_queue.c b/src/screen_queue.c
index 898011d85b338ef5d4aafc5081703bdebe42464f..491d3321070076d6d0827b90bdda861b04c0f33f 100644 (file)
--- a/src/screen_queue.c
+++ b/src/screen_queue.c
handle_mouse_event(struct mpdclient *c)
{
int row;
- unsigned selected;
unsigned long bstate;
+ unsigned old_selected;
if (screen_get_mouse_event(c, &bstate, &row) ||
list_window_mouse(lw, bstate, row)) {
return true;
}
- selected = lw->start + row;
+ old_selected = lw->selected;
+ list_window_set_cursor(lw, lw->start + row);
if (bstate & BUTTON1_CLICKED) {
/* play */
- if (lw->start + row < playlist_length(playlist))
+ if (lw->selected < playlist_length(playlist))
mpdclient_cmd_play(c, lw->start + row);
} else if (bstate & BUTTON3_CLICKED) {
/* delete */
- if (selected == lw->selected)
+ if (lw->selected == old_selected)
mpdclient_cmd_delete(c, lw->selected);
list_window_set_length(lw, playlist_length(playlist));
}
- list_window_set_cursor(lw, selected);
screen_queue_save_selection();
screen_queue_repaint();