From 520c845fa160a3924b097cb69e7dddbfef61371d Mon Sep 17 00:00:00 2001 From: waker Date: Tue, 26 Oct 2010 20:18:07 +0200 Subject: fixed ctrl+j (find current track) not working with multiple playlists --- plugins/gtkui/gtkui.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index ae7ce4ee..f0135033 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -1070,9 +1070,16 @@ void gtkui_focus_on_playing_track (void) { DB_playItem_t *it = deadbeef->streamer_get_playing_track (); if (it) { + int plt = deadbeef->streamer_get_current_playlist (); + if (plt != deadbeef->plt_get_curr ()) { + deadbeef->plt_set_curr (plt); + } int idx = deadbeef->pl_get_idx_of (it); - ddb_listview_scroll_to (DDB_LISTVIEW (lookup_widget (mainwin, "playlist")), idx); - ddb_listview_set_cursor (DDB_LISTVIEW (lookup_widget (mainwin, "playlist")), idx); + if (idx != -1) { + DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); + ddb_listview_scroll_to (pl, idx); + ddb_listview_set_cursor (pl, idx); + } deadbeef->pl_item_unref (it); } } -- cgit v1.2.3