aboutsummaryrefslogtreecommitdiff
path: root/src/sound-service.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-01-27 16:32:35 +0000
committerConor Curran <conor.curran@canonical.com>2010-01-27 16:32:35 +0000
commite483b4902a4fb6ee81de8f24f6f8de65955da083 (patch)
tree42b59f98dcdba5a79a54dfd6a3e9f40fc0f4dc09 /src/sound-service.c
parent170afb3ecc0e216a34945eb31a9743d86bf9c325 (diff)
downloadayatana-indicator-sound-e483b4902a4fb6ee81de8f24f6f8de65955da083.tar.gz
ayatana-indicator-sound-e483b4902a4fb6ee81de8f24f6f8de65955da083.tar.bz2
ayatana-indicator-sound-e483b4902a4fb6ee81de8f24f6f8de65955da083.zip
UI startup now happens after gathering enough PA information re sinks and states
Diffstat (limited to 'src/sound-service.c')
-rw-r--r--src/sound-service.c14
1 files changed, 9 insertions, 5 deletions
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);