changeset 3679:eadc001add02

Remove mainwin_attach_idle_func(), use mainwin_idle_func() only when tristate buttons are triggered.
author William Pitcock <nenolod@atheme.org>
date Mon, 01 Oct 2007 13:42:37 -0500
parents e82ad057d1db
children 6615978ca88c
files src/audacious/main.c src/audacious/ui_main.c src/audacious/ui_main.h
diffstat 3 files changed, 11 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/main.c	Mon Oct 01 12:38:51 2007 -0500
+++ b/src/audacious/main.c	Mon Oct 01 13:42:37 2007 -0500
@@ -1471,7 +1471,6 @@
         hint_set_always(cfg.always_on_top);
 
         playlist_start_get_info_thread();
-        mainwin_attach_idle_func();
 
         has_x11_connection = TRUE;
 
--- a/src/audacious/ui_main.c	Mon Oct 01 12:38:51 2007 -0500
+++ b/src/audacious/ui_main.c	Mon Oct 01 13:42:37 2007 -0500
@@ -1292,6 +1292,8 @@
 
     seek_initial_pos = ui_skinned_horizontal_slider_get_position(mainwin_position);
     seek_state = MAINWIN_SEEK_REV;
+    mainwin_timeout_id = g_timeout_add(MAINWIN_UPDATE_INTERVAL,
+        (GSourceFunc) mainwin_idle_func, NULL);
 }
 
 void
@@ -1320,14 +1322,20 @@
     }
 
     seek_state = MAINWIN_SEEK_NIL;
+
+    g_source_remove(mainwin_timeout_id);
+    mainwin_timeout_id = 0;
 }
 
 void
 mainwin_fwd_pushed(void)
 {
     g_get_current_time(&cb_time);
+
     seek_initial_pos = ui_skinned_horizontal_slider_get_position(mainwin_position);
     seek_state = MAINWIN_SEEK_FWD;
+    mainwin_timeout_id = g_timeout_add(MAINWIN_UPDATE_INTERVAL,
+        (GSourceFunc) mainwin_idle_func, NULL);
 }
 
 void
@@ -1356,6 +1364,9 @@
     }
 
     seek_state = MAINWIN_SEEK_NIL;
+
+    g_source_remove(mainwin_timeout_id);
+    mainwin_timeout_id = 0;
 }
 
 void
@@ -2486,13 +2497,6 @@
     mainwin_create_widgets();
 }
 
-void
-mainwin_attach_idle_func(void)
-{
-    mainwin_timeout_id = g_timeout_add(MAINWIN_UPDATE_INTERVAL,
-                                       mainwin_idle_func, NULL);
-}
-
 gboolean
 mainwin_update_song_info(void)
 {
--- a/src/audacious/ui_main.h	Mon Oct 01 12:38:51 2007 -0500
+++ b/src/audacious/ui_main.h	Mon Oct 01 13:42:37 2007 -0500
@@ -164,7 +164,6 @@
                                    guint action,
                                    GtkWidget * widget);
 
-void mainwin_attach_idle_func(void);
 gboolean mainwin_update_song_info(void);
 void mainwin_drag_data_received(GtkWidget * widget,
                                 GdkDragContext * context,