aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-sound.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/indicator-sound.c')
-rw-r--r--src/indicator-sound.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index 9843bd3..09faff1 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -160,6 +160,7 @@ static void indicator_sound_init (IndicatorSound *self)
prepare_state_machine();
prepare_blocked_animation();
animation_id = 0;
+ blocked_id = 0;
initial_mute = FALSE;
device_available = TRUE;
slider_in_direct_use = FALSE;
@@ -372,7 +373,7 @@ static void prepare_blocked_animation()
return;
}
- // sample 22 snapshots - range : 0-256
+ // sample 51 snapshots - range : 0-256
for(i = 0; i < 51; i++)
{
gdk_pixbuf_composite(mute_buf, blocked_buf, 0, 0,
@@ -504,7 +505,7 @@ static void fetch_mute_value_from_dbus()
static void catch_signal_sink_input_while_muted(DBusGProxy * proxy, gboolean block_value, gpointer userdata)
{
g_debug("signal caught - sink input while muted with value %i", block_value);
- if (block_value == 1 && animation_id == 0 && blocked_animation_list != NULL) {
+ if (block_value == 1 && blocked_id == 0 && animation_id == 0 && blocked_animation_list != NULL) {
gchar* image_name = g_hash_table_lookup(volume_states, GINT_TO_POINTER(STATE_MUTED_WHILE_INPUT));
indicator_image_helper_update(speaker_image, image_name);
blocked_id = g_timeout_add_seconds(5, start_animation, NULL);
@@ -515,8 +516,8 @@ static gboolean start_animation()
{
blocked_iter = blocked_animation_list;
blocked_id = 0;
+ g_debug("exit from blocked hold start the animation\n");
animation_id = g_timeout_add(50, fade_back_to_mute_image, NULL);
- g_debug("exit from blocked hold\n");
return FALSE;
}
@@ -564,6 +565,11 @@ static void catch_signal_sink_mute_update(DBusGProxy *proxy, gboolean mute_value
g_source_remove(animation_id);
animation_id = 0;
}
+ if(blocked_id != 0){
+ g_debug("about to remove the blocked_id callback from the mainloop!!**");
+ g_source_remove(blocked_id);
+ blocked_id = 0;
+ }
}
g_debug("signal caught - sink mute update with mute value: %i", mute_value);
gtk_widget_set_sensitive(volume_slider, !mute_value);