From e483b4902a4fb6ee81de8f24f6f8de65955da083 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 27 Jan 2010 16:32:35 +0000 Subject: UI startup now happens after gathering enough PA information re sinks and states --- src/sound-service.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/sound-service.c') diff --git a/src/sound-service.c b/src/sound-service.c index 7f4b588..31e7b82 100644 --- a/src/sound-service.c +++ b/src/sound-service.c @@ -70,12 +70,16 @@ static void retrieve_complete_sink_list(pa_context *c, const pa_sink_info *sink, g_debug("Available sink is named %s", only_sink->name); g_debug("does Available sink have an active port: %i", only_sink->active_port != NULL); g_debug("sink_available = %i", sink_available); - return; } - sink_available = TRUE; - return; + else{ + sink_available = TRUE; + } + // At this point we can be confident we know enough from PA to draw the UI + rebuild_sound_menu (root_menuitem, dbus_interface); + } + else{ + g_ptr_array_add(sink_list, (gpointer)sink); } - g_ptr_array_add(sink_list, (gpointer)sink); } @@ -245,7 +249,7 @@ main (int argc, char ** argv) pa_context_set_state_callback(pulse_context, context_state_callback, NULL); pa_context_connect(pulse_context, NULL, PA_CONTEXT_NOAUTOSPAWN, NULL); - rebuild_sound_menu (root_menuitem, dbus_interface); + //rebuild_sound_menu (root_menuitem, dbus_interface); // Run the loop mainloop = g_main_loop_new(NULL, FALSE); -- cgit v1.2.3