From f13d1a5ef35117bb9010784549e218bf0c460068 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Sun, 6 Dec 2009 21:20:56 +0100 Subject: fixed race condition in update_songinfo; also seekbar drawing is much smoother now --- plugins/gtkui/gtkui.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index 8c1d265c..81ba6571 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -48,8 +48,8 @@ static int sb_context_id = -1; static char sb_text[512]; static float last_songpos = -1; -static void -update_songinfo (void) { +static gboolean +update_songinfo (gpointer ctx) { char sbtext_new[512] = "-"; float songpos = last_songpos; @@ -146,6 +146,7 @@ update_songinfo (void) { } } } + return FALSE; } gboolean @@ -281,7 +282,7 @@ gtkui_on_playlistchanged (DB_event_t *ev, uintptr_t data) { static int gtkui_on_frameupdate (DB_event_t *ev, uintptr_t data) { - update_songinfo (); + g_idle_add (update_songinfo, NULL); } static int -- cgit v1.2.3