changeset 4743:df6cd6f44a4f

block value-changed signal handler before setting new range on position slider
author Tomasz Mon <desowin@gmail.com>
date Thu, 24 Jul 2008 15:32:42 +0200
parents f9a672bec635
children 34e0d0de2018
files src/audacious/ui_new.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/ui_new.c	Mon Jul 21 08:26:17 2008 -0500
+++ b/src/audacious/ui_new.c	Thu Jul 24 15:32:42 2008 +0200
@@ -97,7 +97,12 @@
 {
     gint length = playback_get_length();
 
+    /* block "value-changed" signal handler to prevent skipping track
+       if the next track is shorter than the previous one --desowin */
+    g_signal_handler_block(slider, slider_change_handler_id);
     gtk_range_set_range(GTK_RANGE(slider), 0.0, (gdouble)length);
+    g_signal_handler_unblock(slider, slider_change_handler_id);
+
     gtk_widget_show(label_time);
 
     ui_playlist_widget_set_current(treeview, playlist_get_position(playlist_get_active()));
@@ -134,7 +139,7 @@
 {
     if (!playback_get_playing())
     {
-        gtk_range_set_value(GTK_RANGE(slider), (gdouble)0);
+        gtk_range_set_value(GTK_RANGE(slider), 0.0);
         return FALSE;
     }