Subject: Make sure speaker test picks up the right sound theme
Author: David Henningsson <david.henningsson@canonical.com>
Bug-Ubuntu: http://bugs.launchpad.net/bugs/736349
Forwarded: No
diff -Nur -x '*.orig' -x '*~' gnome-media-2.32.0//gnome-volume-control/src/gvc-speaker-test.c gnome-media-2.32.0.new//gnome-volume-control/src/gvc-speaker-test.c
--- gnome-media-2.32.0//gnome-volume-control/src/gvc-speaker-test.c	2010-09-28 16:46:15.000000000 +0200
+++ gnome-media-2.32.0.new//gnome-volume-control/src/gvc-speaker-test.c	2011-04-06 20:06:39.048173670 +0200
@@ -429,6 +429,22 @@
         }
 }
 
+static void 
+gvc_speaker_test_set_theme (ca_context *ca)
+{
+        GtkSettings *s = gtk_settings_get_for_screen(gdk_screen_get_default());
+        gchar *theme_name = NULL;
+
+        if (!s) return;
+
+        g_object_get(G_OBJECT(s), "gtk-sound-theme-name", &theme_name, NULL);
+
+        if (theme_name) {
+                ca_context_change_props(ca, CA_PROP_CANBERRA_XDG_THEME_NAME, theme_name, NULL);
+                g_free(theme_name);
+        }
+}
+
 static void
 gvc_speaker_test_init (GvcSpeakerTest *speaker_test)
 {
@@ -441,6 +457,7 @@
         ca_context_change_props (speaker_test->priv->canberra,
                                  CA_PROP_APPLICATION_ID, "org.gnome.VolumeControl",
                                  NULL);
+        gvc_speaker_test_set_theme(speaker_test->priv->canberra);
 
         gtk_table_resize (GTK_TABLE (speaker_test), 3, 5);
         gtk_container_set_border_width (GTK_CONTAINER (speaker_test), 12);
