# HG changeset patch # User Giacomo Lozito # Date 1187389911 -7200 # Node ID 8430c3911856c7a5ddef292387cc02092231010e # Parent 678ea77b6b1f4d9a648d0a4f2dd2b5db8eb2f8f3 playlist_get_info_func works in a different thread, so trying to do UI updates from it eventually leads to UI freeze; fixed to schedule those updates in the main loop instead of doing them directly diff -r 678ea77b6b1f -r 8430c3911856 src/audacious/playlist.c --- a/src/audacious/playlist.c Fri Aug 17 18:52:46 2007 +0900 +++ b/src/audacious/playlist.c Sat Aug 18 00:31:51 2007 +0200 @@ -2504,6 +2504,14 @@ return result; } +static gboolean +playlist_request_win_update(gpointer unused) +{ + Playlist *playlist = playlist_get_active(); + playlistwin_update_list(playlist); + return FALSE; /* to be called only once */ +} + static gpointer playlist_get_info_func(gpointer arg) { @@ -2600,7 +2608,9 @@ } if (update_playlistwin) { - playlistwin_update_list(playlist); + /* we are in a different thread, so we can't do UI updates directly; + instead, schedule a playlist update in the main loop --giacomo */ + g_idle_add_full(G_PRIORITY_HIGH_IDLE, playlist_request_win_update, NULL, NULL); update_playlistwin = FALSE; }