changeset 3083:7d33bbe11736

From: Daniel Drake <dsd@gentoo.org> No need to check for titlebar updates 100 times every second. I also confirmed that the mainwin_set_info_text() and playlistwin_update_list() are already called in sensible codepaths, so those calls can go as well.
author William Pitcock <nenolod@atheme-project.org>
date Mon, 16 Jul 2007 13:31:52 -0500
parents 91df04ec5ef7
children 20830a69b5f5 7fbe8ada95ca
files src/audacious/ui_main.c
diffstat 1 files changed, 3 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/ui_main.c	Mon Jul 16 13:31:51 2007 -0500
+++ b/src/audacious/ui_main.c	Mon Jul 16 13:31:52 2007 -0500
@@ -162,10 +162,7 @@
 
 static gint mainwin_timeout_id;
 
-G_LOCK_DEFINE_STATIC(mainwin_title);
-
 static gboolean mainwin_force_redraw = FALSE;
-static gchar *mainwin_title_text = NULL;
 static gboolean mainwin_info_text_locked = FALSE;
 
 static int ab_position_a = -1;
@@ -682,10 +679,8 @@
 void
 mainwin_set_song_title(const gchar * title)
 {
-    G_LOCK(mainwin_title);
-    g_free(mainwin_title_text);
-    mainwin_title_text = make_mainwin_title(title);
-    G_UNLOCK(mainwin_title);
+    gchar *mainwin_title_text = make_mainwin_title(title);
+    gtk_window_set_title(GTK_WINDOW(mainwin), mainwin_title_text);
 }
 
 static void
@@ -933,10 +928,7 @@
         return;
 
     /* clear title */
-    G_LOCK(mainwin_title);
-    g_free(mainwin_title_text);
-    mainwin_title_text = NULL;
-    G_UNLOCK(mainwin_title);
+    mainwin_set_song_title(NULL);
 
     /* clear sampling parameters */
     playback_set_sample_params(0, 0, 0);
@@ -3110,17 +3102,6 @@
     draw_equalizer_window(FALSE);
     draw_playlist_window(FALSE);
 
-    if (mainwin_title_text) {
-        G_LOCK(mainwin_title);
-        gtk_window_set_title(GTK_WINDOW(mainwin), mainwin_title_text);
-        g_free(mainwin_title_text);
-        mainwin_title_text = NULL;
-        G_UNLOCK(mainwin_title);
-
-        mainwin_set_info_text();
-        playlistwin_update_list(playlist_get_active());
-    }
-
     /* tristate buttons seek */
     if ( seek_state != MAINWIN_SEEK_NIL )
     {