aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-sound.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-10-05 17:13:14 +0100
committerConor Curran <conor.curran@canonical.com>2010-10-05 17:13:14 +0100
commit4fc0ff60801ac25c7edbf099916a96d12089818c (patch)
tree9d62766d5b08cd077f907698feeced0e42e640ff /src/indicator-sound.c
parent9b26353772d0631f2c731111e56d545a87169d56 (diff)
downloadayatana-indicator-sound-4fc0ff60801ac25c7edbf099916a96d12089818c.tar.gz
ayatana-indicator-sound-4fc0ff60801ac25c7edbf099916a96d12089818c.tar.bz2
ayatana-indicator-sound-4fc0ff60801ac25c7edbf099916a96d12089818c.zip
annoying race condition fixed
Diffstat (limited to 'src/indicator-sound.c')
-rw-r--r--src/indicator-sound.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index ecf62a8..05b6eca 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -68,7 +68,6 @@ static GtkImage * get_icon (IndicatorObject * io);
static GtkMenu * get_menu (IndicatorObject * io);
static void indicator_sound_scroll (IndicatorObject* io, gint delta, IndicatorScrollDirection direction);
-
//Slider related
static gboolean new_volume_slider_widget(DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client);
static gboolean key_press_cb(GtkWidget* widget, GdkEventKey* event, gpointer data);
@@ -196,12 +195,13 @@ get_label (IndicatorObject * io)
static GtkImage *
get_icon (IndicatorObject * io)
{
- gchar* current_name = g_hash_table_lookup(volume_states,
+ gchar* current_name = g_hash_table_lookup(volume_states,
GINT_TO_POINTER(current_state));
//g_debug("At start-up attempting to set the image to %s",
// current_name);
speaker_image = indicator_image_helper(current_name);
gtk_widget_show(GTK_WIDGET(speaker_image));
+
return speaker_image;
}
@@ -324,6 +324,8 @@ new_volume_slider_widget(DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent,
newitem,
menu_volume_item,
parent);
+ fetch_mute_value_from_dbus();
+ fetch_sink_availability_from_dbus(INDICATOR_SOUND (io));
return TRUE;
}
@@ -359,6 +361,7 @@ connection_changed (IndicatorServiceManager * sm, gboolean connected, gpointer u
dbus_g_proxy_connect_signal(sound_dbus_proxy, SIGNAL_SINK_MUTE_UPDATE, G_CALLBACK(catch_signal_sink_mute_update), user_data, NULL);
dbus_g_proxy_add_signal(sound_dbus_proxy, SIGNAL_SINK_AVAILABLE_UPDATE, G_TYPE_BOOLEAN, G_TYPE_INVALID);
dbus_g_proxy_connect_signal(sound_dbus_proxy, SIGNAL_SINK_AVAILABLE_UPDATE, G_CALLBACK(catch_signal_sink_availability_update), NULL, NULL);
+
if( service_restart == TRUE){
fetch_mute_value_from_dbus();
// Ensure UI is in sync with service again.
@@ -584,10 +587,11 @@ fetch_mute_value_from_dbus()
return;
}
initial_mute = *mute_input;
- if (initial_mute == TRUE)
+ if (initial_mute == TRUE){
update_state(STATE_MUTED);
+ }
g_free(mute_input);
- //g_debug("at the indicator start up and the MUTE returned from dbus method is %i", initial_mute);
+ g_debug("at the indicator start up and the MUTE returned from dbus method is %i", initial_mute);
}
/*******************************************************************/