aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-10-05 17:50:19 +0100
committerConor Curran <conor.curran@canonical.com>2010-10-05 17:50:19 +0100
commit6a2214ba0ab2dad2963f94f65639845eb35fafaa (patch)
tree2dc63b4db35be80a2173f8722a19420e6ea9e944
parent9b26353772d0631f2c731111e56d545a87169d56 (diff)
parent352919657eab5a4e1fc63e6191cc088b148ab376 (diff)
downloadayatana-indicator-sound-6a2214ba0ab2dad2963f94f65639845eb35fafaa.tar.gz
ayatana-indicator-sound-6a2214ba0ab2dad2963f94f65639845eb35fafaa.tar.bz2
ayatana-indicator-sound-6a2214ba0ab2dad2963f94f65639845eb35fafaa.zip
merged unmute state icon bug
-rw-r--r--src/indicator-sound.c12
-rw-r--r--src/pulse-manager.c30
2 files changed, 8 insertions, 34 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);
}
/*******************************************************************/
diff --git a/src/pulse-manager.c b/src/pulse-manager.c
index b8e2ef7..8779525 100644
--- a/src/pulse-manager.c
+++ b/src/pulse-manager.c
@@ -43,7 +43,6 @@ static void pulse_server_info_callback(pa_context *c, const pa_server_info *info
static void update_sink_info(pa_context *c, const pa_sink_info *info, int eol, void *userdata);
static void destroy_sink_info(void *value);
static gboolean determine_sink_availability();
-static void reconnect_to_pulse();
static gboolean has_volume_changed(const pa_sink_info* new_sink, sink_info* cached_sink);
static pa_cvolume construct_mono_volume(const pa_cvolume* vol);
@@ -100,35 +99,6 @@ void close_pulse_activites()
}
/**
-reconnect_to_pulse()
-In the event of Pulseaudio flapping in the wind handle gracefully without
-memory leaks !
-*/
-static void reconnect_to_pulse()
-{
- // reset
- if (pulse_context != NULL) {
- g_debug("freeing the pulse context");
- pa_context_unref(pulse_context);
- pulse_context = NULL;
- }
-
- if (sink_hash != NULL) {
- g_hash_table_destroy(sink_hash);
- sink_hash = NULL;
- }
-
- // reconnect
- pulse_context = pa_context_new(pa_glib_mainloop_get_api(pa_main_loop), "ayatana.indicator.sound");
- g_assert(pulse_context);
- sink_hash = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, destroy_sink_info);
- // Establish event callback registration
- pa_context_set_state_callback(pulse_context, context_state_callback, NULL);
- dbus_menu_manager_update_pa_state(FALSE, FALSE, FALSE, 0);
- pa_context_connect(pulse_context, NULL, PA_CONTEXT_NOFAIL, NULL);
-}
-
-/**
destroy_sink_info()
item destructor method for the sink_info hash
**/