summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Matos <tiagomatos@gmail.com>2014-10-20 15:48:40 +0200
committerRui Matos <tiagomatos@gmail.com>2014-10-21 15:46:25 +0200
commit123cf41a523388e37f99a8c394b391a5f9fdeaad (patch)
tree0901dd68a5a9795a5704d760c2ecc83c9506e159
parentd1dd0474ed03b65e09086712033add3f7d3af5ec (diff)
downloadgnome-control-center-123cf41a523388e37f99a8c394b391a5f9fdeaad.tar.gz
sound: Fix the main volume bars to correctly display changes in volume
The active input and output streams aren't added through add_stream() so they weren't being mapped to their respective volume bars, resulting in updates to the volume through other means not being reflected in our UI. Moving the mapping to bar_set_stream() which is called for every stream fixes the problem. Also, there's no value in having a helper function to do a g_hash_table_insert() and not doing the same for the respective g_hash_table_remove()s so remove it. https://bugzilla.gnome.org/show_bug.cgi?id=738869
-rw-r--r--panels/sound/gvc-mixer-dialog.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/panels/sound/gvc-mixer-dialog.c b/panels/sound/gvc-mixer-dialog.c
index 30749fa93..943a2d983 100644
--- a/panels/sound/gvc-mixer-dialog.c
+++ b/panels/sound/gvc-mixer-dialog.c
@@ -756,16 +756,6 @@ on_stream_is_muted_notify (GObject *object,
}
-static void
-save_bar_for_stream (GvcMixerDialog *dialog,
- GvcMixerStream *stream,
- GtkWidget *bar)
-{
- g_hash_table_insert (dialog->priv->bars,
- GUINT_TO_POINTER (gvc_mixer_stream_get_id (stream)),
- bar);
-}
-
static GtkWidget *
create_bar (GvcMixerDialog *dialog,
gboolean add_to_size_group,
@@ -991,6 +981,9 @@ bar_set_stream (GvcMixerDialog *dialog,
"value-changed",
G_CALLBACK (on_adjustment_value_changed),
dialog);
+ g_hash_table_insert (dialog->priv->bars,
+ GUINT_TO_POINTER (gvc_mixer_stream_get_id (stream)),
+ bar);
}
}
@@ -1038,7 +1031,6 @@ add_stream (GvcMixerDialog *dialog,
g_signal_handlers_disconnect_by_func (old_stream, on_stream_volume_notify, dialog);
g_hash_table_remove (dialog->priv->bars, GUINT_TO_POINTER (gvc_mixer_stream_get_id (old_stream)));
}
- save_bar_for_stream (dialog, stream, bar);
bar_set_stream (dialog, bar, stream);
gtk_widget_show (bar);
}