diff options
Diffstat (limited to 'plugins/gtkui/gtkui.c')
-rw-r--r-- | plugins/gtkui/gtkui.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index 9c7eb63b..f740bacb 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -992,7 +992,9 @@ gtkui_thread (void *ctx) { deadbeef->pl_format_title (NULL, -1, str, sizeof (str), -1, deadbeef->conf_get_str ("gtkui.titlebar_stopped", "DeaDBeeF-%V")); gtk_window_set_title (GTK_WINDOW (mainwin), str); gtk_initialized = 1; + gtk_main (); + cover_art_free (); eq_window_destroy (); trkproperties_destroy (); @@ -1062,6 +1064,17 @@ gtkui_pl_add_files_end (void) { gtkui_original_pl_add_files_end (); } +void +gtkui_focus_on_playing_track (void) { + DB_playItem_t *it = deadbeef->streamer_get_playing_track (); + if (it) { + 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); + deadbeef->pl_item_unref (it); + } +} + static int gtkui_start (void) { // gtk must be running in separate thread |