=== modified file 'src/bubble.c'
--- src/bubble.c	2011-07-08 15:42:45 +0000
+++ src/bubble.c	2011-07-21 01:06:19 +0000
@@ -663,11 +663,17 @@
 	}
 
 	// clear, render top-left part of shadow/background in scratch-surface
-    	cairo_scale (cr, 1.0f, 1.0f);
+    cairo_scale (cr, 1.0f, 1.0f);
 	cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
 	cairo_paint (cr);
 	cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
 
+	GdkColor color;
+	gchar* color_string = NULL;
+    color_string = defaults_get_bubble_bg_color (d);
+	gdk_color_parse (color_string, &color);
+    g_free (color_string);
+	
 	if (priv->composited)
 	{
 		_draw_shadow (
@@ -689,16 +695,16 @@
 		cairo_fill (cr);
 		cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
 		cairo_set_source_rgba (cr,
-				       BUBBLE_BG_COLOR_R,
-				       BUBBLE_BG_COLOR_G,
-				       BUBBLE_BG_COLOR_B,
+				       0.75 * ((double) color.red / 65535.0),
+				       0.75 * ((double) color.green / 65535.0),
+				       0.75 * ((double) color.blue / 65535.0),
 				       BUBBLE_BG_COLOR_A);
 	}
 	else
 		cairo_set_source_rgb (cr,
-				      BUBBLE_BG_COLOR_R,
-				      BUBBLE_BG_COLOR_G,
-				      BUBBLE_BG_COLOR_B);
+				       0.75 * ((double) color.red / 65535.0),
+				       0.75 * ((double) color.green / 65535.0),
+				       0.75 * ((double) color.blue / 65535.0));
 
 	draw_round_rect (
 		cr,

=== modified file 'src/defaults.c'
--- src/defaults.c	2011-07-13 17:22:48 +0000
+++ src/defaults.c	2011-07-21 01:06:19 +0000
@@ -154,6 +154,10 @@
 #define GNOME_DESKTOP_SCHEMA         "org.gnome.desktop.interface"
 #define GSETTINGS_FONT_KEY           "font-name"
 
+/* unity settings */
+#define UNITY_SCHEMA                 "com.canonical.Unity"
+#define GSETTINGS_AVG_BG_COL_KEY     "average-bg-color"
+
 static guint g_defaults_signals[LAST_SIGNAL] = { 0 };
 
 /*-- internal API ------------------------------------------------------------*/
@@ -285,6 +289,26 @@
 	g_signal_emit (defaults, g_defaults_signals[GRAVITY_CHANGED], 0);
 }
 
+static void
+_avg_bg_color_changed (GSettings* settings,
+                       gchar*     key,
+                       gpointer   data)
+{
+	Defaults* defaults     = NULL;
+    gchar*    color_string = NULL;
+
+	if (!data)
+		return;
+
+	defaults = (Defaults*) data;
+	if (!IS_DEFAULTS (defaults))
+		return;
+
+	color_string = g_settings_get_string (settings, key);
+	g_object_set (defaults, "bubble-bg-color", color_string, NULL);
+	g_free (color_string);
+}
+
 void
 defaults_refresh_screen_dimension_properties (Defaults *self)
 {
@@ -403,6 +427,10 @@
 			      NULL);
 	}
 
+    _avg_bg_color_changed (self->unity_settings,
+                           GSETTINGS_AVG_BG_COL_KEY,
+                           self);
+
 	/* FIXME: calling this here causes a segfault */
 	/* chain up to the parent class */
 	/*G_OBJECT_CLASS (defaults_parent_class)->constructed (gobject);*/
@@ -417,6 +445,7 @@
 
 	g_object_unref (defaults->nosd_settings);
 	g_object_unref (defaults->gnome_settings);
+	g_object_unref (defaults->unity_settings);
 
 	if (defaults->bubble_shadow_color)
 	{
@@ -482,7 +511,8 @@
 {
 	/* "connect" to the required GSettings schemas */
 	self->nosd_settings  = g_settings_new (NOTIFY_OSD_SCHEMA);
-	self->gnome_settings = g_settings_new (GNOME_DESKTOP_SCHEMA);; 
+	self->gnome_settings = g_settings_new (GNOME_DESKTOP_SCHEMA);
+    self->unity_settings = g_settings_new (UNITY_SCHEMA);
 
 	g_signal_connect (self->gnome_settings,
 					  "changed",
@@ -494,6 +524,11 @@
 					  G_CALLBACK (_gravity_changed),
 					  self);
 
+    g_signal_connect (self->unity_settings,
+					  "changed",
+					  G_CALLBACK (_avg_bg_color_changed),
+					  self);
+
 	// use fixed slot-allocation for async. and sync. bubbles
 	self->slot_allocation = SLOT_ALLOCATION_FIXED;
 }

=== modified file 'src/defaults.h'
--- src/defaults.h	2011-07-13 17:22:48 +0000
+++ src/defaults.h	2011-07-21 01:06:19 +0000
@@ -76,6 +76,7 @@
 	/* private */
 	GSettings*     nosd_settings;
 	GSettings*     gnome_settings;
+	GSettings*     unity_settings;
 	gint           desktop_width;
 	gint           desktop_height;
 	gint           desktop_top;

