[gnome-control-center/gnome-3-8] Revert "sound: Fix the main volume bars to correctly display changes in volume"



commit 560a2f08b3f14a1403db6a9a6f0b7cde04d8cd69
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Mar 17 12:06:21 2015 +0100

    Revert "sound: Fix the main volume bars to correctly display changes in volume"
    
    This results in crashes when switching inputs or outputs, as other parts
    of the code expect only application bars being added to that hashtable.
    The bar was destroyed when switching outputs (as the stream is removed before
    a new one being added) but with the bar pointing to freed memory.
    
    This reverts commit 22fa7f1292922621ab6099019f810c2b0a621c99.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746227

 panels/sound/gvc-mixer-dialog.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/panels/sound/gvc-mixer-dialog.c b/panels/sound/gvc-mixer-dialog.c
index 7cd49f0..ae19c75 100644
--- a/panels/sound/gvc-mixer-dialog.c
+++ b/panels/sound/gvc-mixer-dialog.c
@@ -756,6 +756,16 @@ 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,
@@ -981,9 +991,6 @@ 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);
         }
 }
 
@@ -1031,6 +1038,7 @@ 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);
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]