Mercurial > audlegacy
comparison src/audacious/ui_main.c @ 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 |
comparison
equal
deleted
inserted
replaced
3082:91df04ec5ef7 | 3083:7d33bbe11736 |
---|---|
160 static GtkWidget *mainwin_srew, *mainwin_splay, *mainwin_spause; | 160 static GtkWidget *mainwin_srew, *mainwin_splay, *mainwin_spause; |
161 static GtkWidget *mainwin_sstop, *mainwin_sfwd, *mainwin_seject, *mainwin_about; | 161 static GtkWidget *mainwin_sstop, *mainwin_sfwd, *mainwin_seject, *mainwin_about; |
162 | 162 |
163 static gint mainwin_timeout_id; | 163 static gint mainwin_timeout_id; |
164 | 164 |
165 G_LOCK_DEFINE_STATIC(mainwin_title); | |
166 | |
167 static gboolean mainwin_force_redraw = FALSE; | 165 static gboolean mainwin_force_redraw = FALSE; |
168 static gchar *mainwin_title_text = NULL; | |
169 static gboolean mainwin_info_text_locked = FALSE; | 166 static gboolean mainwin_info_text_locked = FALSE; |
170 | 167 |
171 static int ab_position_a = -1; | 168 static int ab_position_a = -1; |
172 static int ab_position_b = -1; | 169 static int ab_position_b = -1; |
173 | 170 |
680 } | 677 } |
681 | 678 |
682 void | 679 void |
683 mainwin_set_song_title(const gchar * title) | 680 mainwin_set_song_title(const gchar * title) |
684 { | 681 { |
685 G_LOCK(mainwin_title); | 682 gchar *mainwin_title_text = make_mainwin_title(title); |
686 g_free(mainwin_title_text); | 683 gtk_window_set_title(GTK_WINDOW(mainwin), mainwin_title_text); |
687 mainwin_title_text = make_mainwin_title(title); | |
688 G_UNLOCK(mainwin_title); | |
689 } | 684 } |
690 | 685 |
691 static void | 686 static void |
692 mainwin_refresh_hints(void) | 687 mainwin_refresh_hints(void) |
693 { | 688 { |
931 { | 926 { |
932 if (!mainwin) | 927 if (!mainwin) |
933 return; | 928 return; |
934 | 929 |
935 /* clear title */ | 930 /* clear title */ |
936 G_LOCK(mainwin_title); | 931 mainwin_set_song_title(NULL); |
937 g_free(mainwin_title_text); | |
938 mainwin_title_text = NULL; | |
939 G_UNLOCK(mainwin_title); | |
940 | 932 |
941 /* clear sampling parameters */ | 933 /* clear sampling parameters */ |
942 playback_set_sample_params(0, 0, 0); | 934 playback_set_sample_params(0, 0, 0); |
943 | 935 |
944 UI_SKINNED_HORIZONTAL_SLIDER(mainwin_position)->pressed = FALSE; | 936 UI_SKINNED_HORIZONTAL_SLIDER(mainwin_position)->pressed = FALSE; |
3108 | 3100 |
3109 mainwin_force_redraw = FALSE; | 3101 mainwin_force_redraw = FALSE; |
3110 draw_equalizer_window(FALSE); | 3102 draw_equalizer_window(FALSE); |
3111 draw_playlist_window(FALSE); | 3103 draw_playlist_window(FALSE); |
3112 | 3104 |
3113 if (mainwin_title_text) { | |
3114 G_LOCK(mainwin_title); | |
3115 gtk_window_set_title(GTK_WINDOW(mainwin), mainwin_title_text); | |
3116 g_free(mainwin_title_text); | |
3117 mainwin_title_text = NULL; | |
3118 G_UNLOCK(mainwin_title); | |
3119 | |
3120 mainwin_set_info_text(); | |
3121 playlistwin_update_list(playlist_get_active()); | |
3122 } | |
3123 | |
3124 /* tristate buttons seek */ | 3105 /* tristate buttons seek */ |
3125 if ( seek_state != MAINWIN_SEEK_NIL ) | 3106 if ( seek_state != MAINWIN_SEEK_NIL ) |
3126 { | 3107 { |
3127 GTimeVal now_time; | 3108 GTimeVal now_time; |
3128 GTimeVal delta_time; | 3109 GTimeVal delta_time; |