diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/indicator-sound.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c index a67a0b0..9843bd3 100644 --- a/src/indicator-sound.c +++ b/src/indicator-sound.c @@ -125,11 +125,13 @@ static gboolean device_available; static gboolean slider_in_direct_use; static GtkIconSize design_team_size; +static gint blocked_id; static gint animation_id; static GList * blocked_animation_list = NULL; static GList * blocked_iter = NULL; static void prepare_blocked_animation(); static gboolean fade_back_to_mute_image(); +static gboolean start_animation(); // Construction static void @@ -371,12 +373,12 @@ static void prepare_blocked_animation() } // sample 22 snapshots - range : 0-256 - for(i = 0; i < 23; i++) + for(i = 0; i < 51; i++) { gdk_pixbuf_composite(mute_buf, blocked_buf, 0, 0, gdk_pixbuf_get_width(mute_buf), gdk_pixbuf_get_height(mute_buf), - 0, 0, 1, 1, GDK_INTERP_BILINEAR, MIN(255, i * 11)); + 0, 0, 1, 1, GDK_INTERP_BILINEAR, MIN(255, i * 5)); blocked_animation_list = g_list_append(blocked_animation_list, gdk_pixbuf_copy(blocked_buf)); } } @@ -505,12 +507,19 @@ static void catch_signal_sink_input_while_muted(DBusGProxy * proxy, gboolean blo if (block_value == 1 && 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_iter = blocked_animation_list; - animation_id = g_timeout_add_seconds(1, fade_back_to_mute_image, NULL); + blocked_id = g_timeout_add_seconds(5, start_animation, NULL); } } +static gboolean start_animation() +{ + blocked_iter = blocked_animation_list; + blocked_id = 0; + animation_id = g_timeout_add(50, fade_back_to_mute_image, NULL); + g_debug("exit from blocked hold\n"); + return FALSE; +} + static gboolean fade_back_to_mute_image() { if(blocked_iter != NULL) |