--- gdm-2.15.5/gui/greeter/greeter.c.greeterbackground	2006-06-09 23:07:42.000000000 +0200
+++ gdm-2.15.5/gui/greeter/greeter.c	2006-06-13 07:55:30.000000000 +0200
@@ -1037,7 +1037,6 @@
 int
 main (int argc, char *argv[])
 {
-  char *bg_color;
   struct sigaction hup;
   struct sigaction term;
   sigset_t mask;
@@ -1095,12 +1094,7 @@
   /* Load the background as early as possible so GDM does not leave  */
   /* the background unfilled.   The cursor should be a watch already */
   /* but just in case */
-  bg_color = gdm_config_get_string (GDM_KEY_GRAPHICAL_THEMED_COLOR);
-  /* If a graphical theme color does not exist fallback to the plain color */
-  if (ve_string_empty (bg_color)) {
-    bg_color = gdm_config_get_string (GDM_KEY_BACKGROUND_COLOR);
-  }
-  gdm_common_setup_background_color (bg_color);
+  gdm_common_setup_background (TRUE, gdm_wm_screens, gdm_wm_allscreens);
   greeter_session_init ();
 
   ve_signal_add (SIGHUP, greeter_reread_config, NULL);
--- gdm-2.15.5/gui/gdmchooser.c.greeterbackground	2006-05-12 20:35:51.000000000 +0200
+++ gdm-2.15.5/gui/gdmchooser.c	2006-06-13 07:54:36.000000000 +0200
@@ -146,12 +146,6 @@
 static GSList *bcaddr;
 static GSList *queryaddr;
 
-enum {
-	GDM_BACKGROUND_NONE = 0,
-	GDM_BACKGROUND_IMAGE = 1,
-	GDM_BACKGROUND_COLOR = 2
-};
-
 static GladeXML *chooser_app;
 static GtkWidget *chooser, *manage, *rescan, *cancel, *add_entry, *add_button;
 static GtkWidget *status_label;
@@ -1845,8 +1839,7 @@
 	    gdm_config_reload_int    (GDM_KEY_BACKGROUND_TYPE)) {
 
 		if (gdm_config_get_int (GDM_KEY_BACKGROUND_TYPE) != GDM_BACKGROUND_NONE) {
-			gdm_common_setup_background_color (gdm_config_get_string
-				(GDM_KEY_BACKGROUND_COLOR));
+			gdm_common_setup_background (FALSE, gdm_wm_screens, gdm_wm_allscreens);
 		}
 	}
 
@@ -2011,7 +2004,7 @@
     /* but just in case */
     if (RUNNING_UNDER_GDM) {
 	if (gdm_config_get_int (GDM_KEY_BACKGROUND_TYPE) != GDM_BACKGROUND_NONE)
-		gdm_common_setup_background_color (gdm_config_get_string (GDM_KEY_BACKGROUND_COLOR));
+		gdm_common_setup_background (FALSE, gdm_wm_screens, gdm_wm_allscreens);
 
 	gdm_common_setup_cursor (GDK_WATCH);
     }
--- gdm-2.15.5/gui/gdmcommon.c.greeterbackground	2006-05-15 20:51:37.000000000 +0200
+++ gdm-2.15.5/gui/gdmcommon.c	2006-06-13 07:54:36.000000000 +0200
@@ -453,8 +453,8 @@
 }
 
 /* Not to look too shaby on Xinerama setups */
-void
-gdm_common_setup_background_color (gchar *bg_color)
+static void
+setup_background_color (gchar *bg_color)
 {
   GdkColormap *colormap;
   GdkColor color;
@@ -745,3 +745,162 @@
   return g_string_free (str, FALSE);
 }
 
+static void
+set_root (GdkPixbuf *pb)
+{
+	GdkPixmap *pm;
+	gint width, height;
+
+	g_return_if_fail (pb != NULL);
+
+	gdk_drawable_get_size (gdk_get_default_root_window (), &width, &height);
+	pm = gdk_pixmap_new (gdk_get_default_root_window (), 
+			width, height, -1);
+
+
+	/* paranoia */
+	if (pm == NULL)
+		return;
+
+	gdk_draw_pixbuf (pm, NULL, pb, 0, 0, 0, 0, -1, -1, 
+			GDK_RGB_DITHER_MAX, 0, 0);
+
+	gdk_error_trap_push ();
+
+	gdk_window_set_back_pixmap (gdk_get_default_root_window (),
+				    pm,
+				    FALSE /* parent_relative */);
+
+	g_object_unref (G_OBJECT (pm));
+
+	gdk_window_clear (gdk_get_default_root_window ());
+
+	gdk_flush ();
+	gdk_error_trap_pop ();
+}
+
+static GdkPixbuf *
+render_scaled_back (const GdkPixbuf *pb, int n_screens, GdkRectangle * allscreens)
+{
+	int i;
+	int width, height;
+
+	GdkPixbuf *back = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
+					  gdk_pixbuf_get_has_alpha (pb),
+					  8,
+					  gdk_screen_width (),
+					  gdk_screen_height ());
+
+	width = gdk_pixbuf_get_width (pb);
+	height = gdk_pixbuf_get_height (pb);
+
+	for (i = 0; i < n_screens; i++) {
+		gdk_pixbuf_scale (pb, back,
+				  allscreens[i].x,
+				  allscreens[i].y,
+				  allscreens[i].width,
+				  allscreens[i].height,
+				  allscreens[i].x /* offset_x */,
+				  allscreens[i].y /* offset_y */,
+				  (double) allscreens[i].width / width,
+				  (double) allscreens[i].height / height,
+				  GDK_INTERP_BILINEAR);
+	}
+
+	return back;
+}
+
+static void
+add_color_to_pb (GdkPixbuf *pb, GdkColor *color)
+{
+	int width = gdk_pixbuf_get_width (pb);
+	int height = gdk_pixbuf_get_height (pb);
+	int rowstride = gdk_pixbuf_get_rowstride (pb);
+	guchar *pixels = gdk_pixbuf_get_pixels (pb);
+	gboolean has_alpha = gdk_pixbuf_get_has_alpha (pb);
+	int i;
+	int cr = color->red >> 8;
+	int cg = color->green >> 8;
+	int cb = color->blue >> 8;
+
+	if ( ! has_alpha)
+		return;
+
+	for (i = 0; i < height; i++) {
+		int ii;
+		guchar *p = pixels + (rowstride * i);
+		for (ii = 0; ii < width; ii++) {
+			int r = p[0];
+			int g = p[1];
+			int b = p[2];
+			int a = p[3];
+
+			p[0] = (r * a + cr * (255 - a)) >> 8;
+			p[1] = (g * a + cg * (255 - a)) >> 8;
+			p[2] = (b * a + cb * (255 - a)) >> 8;
+			p[3] = 255;
+
+			p += 4;
+		}
+	}
+}
+
+/* setup background color/image */
+void
+gdm_common_setup_background (gboolean graphical_greeter, int n_screens, GdkRectangle *allscreens)
+{
+	GdkColor color;
+	GdkPixbuf *pb = NULL;
+	gchar *bg_color;	
+	gchar *bg_image = gdm_config_get_string (GDM_KEY_BACKGROUND_IMAGE);
+	gint   bg_type  = gdm_config_get_int    (GDM_KEY_BACKGROUND_TYPE); 
+
+	if (graphical_greeter) {
+		bg_color = gdm_config_get_string (GDM_KEY_GRAPHICAL_THEMED_COLOR);
+	  	/* If a graphical theme color does not exist fallback to the plain color */
+		if (ve_string_empty (bg_color)) {
+		    bg_color = gdm_config_get_string (GDM_KEY_BACKGROUND_COLOR);
+		}
+	}
+	else
+		bg_color = gdm_config_get_string (GDM_KEY_BACKGROUND_COLOR);
+
+	if ((bg_type == GDM_BACKGROUND_IMAGE ||
+	     bg_type == GDM_BACKGROUND_IMAGE_AND_COLOR) &&
+	    ! ve_string_empty (bg_image))
+		pb = gdk_pixbuf_new_from_file (bg_image, NULL);
+
+	/* Load background image */
+	if (pb != NULL) {
+		if (gdk_pixbuf_get_has_alpha (pb)) {
+			if (bg_type == GDM_BACKGROUND_IMAGE_AND_COLOR) {
+				if (bg_color == NULL ||
+				    bg_color[0] == '\0' ||
+				    ! gdk_color_parse (bg_color,
+					       &color)) {
+					gdk_color_parse ("#000000", &color);
+				}
+				add_color_to_pb (pb, &color);
+			}
+		}
+		if (gdm_config_get_bool (GDM_KEY_BACKGROUND_SCALE_TO_FIT)) {
+			GdkPixbuf *spb = render_scaled_back (pb, n_screens, allscreens);
+			g_object_unref (G_OBJECT (pb));
+			pb = spb;
+		}
+
+		/* paranoia */
+		if (pb != NULL) {
+			set_root (pb);
+			g_object_unref (G_OBJECT (pb));
+		}
+	/* Load background color */
+	} else if (bg_type != GDM_BACKGROUND_NONE &&
+	           bg_type != GDM_BACKGROUND_IMAGE) {
+		setup_background_color (bg_color);
+	/* Load default background */
+	} else {
+		gchar *blank_color = g_strdup ("#000000");
+		setup_background_color (blank_color);
+	}
+}
--- gdm-2.15.5/gui/gdmcommon.h.greeterbackground	2006-03-13 22:18:24.000000000 +0100
+++ gdm-2.15.5/gui/gdmcommon.h	2006-06-13 07:54:36.000000000 +0200
@@ -61,10 +61,19 @@
 gchar*	  gdm_common_get_config_file	    (void);
 gchar*	  gdm_common_get_custom_config_file (void);
 gboolean  gdm_common_select_time_format	    (void);
-void	  gdm_common_setup_background_color (gchar *bg_color);
+void	  gdm_common_setup_background       (gboolean graphical_greeter, 
+		                             int n_screens, 
+					     GdkRectangle *allscreens);
 gchar*	  gdm_common_get_welcomemsg	    (void);
 void	  gdm_common_pre_fetch_launch       (void);
 gchar*    gdm_common_expand_text            (const gchar *text);
 gchar*    gdm_common_get_clock              (struct tm **the_tm);
 
+enum {
+	GDM_BACKGROUND_NONE = 0,
+	GDM_BACKGROUND_IMAGE_AND_COLOR = 1,
+	GDM_BACKGROUND_COLOR = 2,
+	GDM_BACKGROUND_IMAGE = 3
+};
+
 #endif /* GDM_COMMON_H */
--- gdm-2.15.5/gui/gdmlogin.c.greeterbackground	2006-05-31 11:24:08.000000000 +0200
+++ gdm-2.15.5/gui/gdmlogin.c	2006-06-13 07:54:36.000000000 +0200
@@ -85,13 +85,6 @@
 	GREETER_ULIST_LOGIN_COLUMN
 };
 
-enum {
-	GDM_BACKGROUND_NONE = 0,
-	GDM_BACKGROUND_IMAGE_AND_COLOR = 1,
-	GDM_BACKGROUND_COLOR = 2,
-	GDM_BACKGROUND_IMAGE = 3,
-};
-
 static GtkWidget *login;
 static GtkWidget *logo_frame = NULL;
 static GtkWidget *logo_image = NULL;
@@ -2936,156 +2929,6 @@
     }
 }
 
-static void
-set_root (GdkPixbuf *pb)
-{
-	GdkPixmap *pm;
-	gint width, height;
-
-	g_return_if_fail (pb != NULL);
-
-	gdk_drawable_get_size (gdk_get_default_root_window (), &width, &height);
-	pm = gdk_pixmap_new (gdk_get_default_root_window (), 
-			width, height, -1);
-
-
-	/* paranoia */
-	if (pm == NULL)
-		return;
-
-	gdk_draw_pixbuf (pm, NULL, pb, 0, 0, 0, 0, -1, -1, 
-			GDK_RGB_DITHER_MAX, 0, 0);
-
-	gdk_error_trap_push ();
-
-	gdk_window_set_back_pixmap (gdk_get_default_root_window (),
-				    pm,
-				    FALSE /* parent_relative */);
-
-	g_object_unref (G_OBJECT (pm));
-
-	gdk_window_clear (gdk_get_default_root_window ());
-
-	gdk_flush ();
-	gdk_error_trap_pop ();
-}
-
-static GdkPixbuf *
-render_scaled_back (const GdkPixbuf *pb)
-{
-	int i;
-	int width, height;
-
-	GdkPixbuf *back = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
-					  gdk_pixbuf_get_has_alpha (pb),
-					  8,
-					  gdk_screen_width (),
-					  gdk_screen_height ());
-
-	width = gdk_pixbuf_get_width (pb);
-	height = gdk_pixbuf_get_height (pb);
-
-	for (i = 0; i < gdm_wm_screens; i++) {
-		gdk_pixbuf_scale (pb, back,
-				  gdm_wm_allscreens[i].x,
-				  gdm_wm_allscreens[i].y,
-				  gdm_wm_allscreens[i].width,
-				  gdm_wm_allscreens[i].height,
-				  gdm_wm_allscreens[i].x /* offset_x */,
-				  gdm_wm_allscreens[i].y /* offset_y */,
-				  (double) gdm_wm_allscreens[i].width / width,
-				  (double) gdm_wm_allscreens[i].height / height,
-				  GDK_INTERP_BILINEAR);
-	}
-
-	return back;
-}
-
-static void
-add_color_to_pb (GdkPixbuf *pb, GdkColor *color)
-{
-	int width = gdk_pixbuf_get_width (pb);
-	int height = gdk_pixbuf_get_height (pb);
-	int rowstride = gdk_pixbuf_get_rowstride (pb);
-	guchar *pixels = gdk_pixbuf_get_pixels (pb);
-	gboolean has_alpha = gdk_pixbuf_get_has_alpha (pb);
-	int i;
-	int cr = color->red >> 8;
-	int cg = color->green >> 8;
-	int cb = color->blue >> 8;
-
-	if ( ! has_alpha)
-		return;
-
-	for (i = 0; i < height; i++) {
-		int ii;
-		guchar *p = pixels + (rowstride * i);
-		for (ii = 0; ii < width; ii++) {
-			int r = p[0];
-			int g = p[1];
-			int b = p[2];
-			int a = p[3];
-
-			p[0] = (r * a + cr * (255 - a)) >> 8;
-			p[1] = (g * a + cg * (255 - a)) >> 8;
-			p[2] = (b * a + cb * (255 - a)) >> 8;
-			p[3] = 255;
-
-			p += 4;
-		}
-	}
-}
-
-/* setup background color/image */
-static void
-setup_background (void)
-{
-	GdkColor color;
-	GdkPixbuf *pb = NULL;
-	gchar *bg_color = gdm_config_get_string (GDM_KEY_BACKGROUND_COLOR);
-	gchar *bg_image = gdm_config_get_string (GDM_KEY_BACKGROUND_IMAGE);
-	gint   bg_type  = gdm_config_get_int    (GDM_KEY_BACKGROUND_TYPE); 
-
-	if ((bg_type == GDM_BACKGROUND_IMAGE ||
-	     bg_type == GDM_BACKGROUND_IMAGE_AND_COLOR) &&
-	    ! ve_string_empty (bg_image))
-		pb = gdk_pixbuf_new_from_file (bg_image, NULL);
-
-	/* Load background image */
-	if (pb != NULL) {
-		if (gdk_pixbuf_get_has_alpha (pb)) {
-			if (bg_type == GDM_BACKGROUND_IMAGE_AND_COLOR) {
-				if (bg_color == NULL ||
-				    bg_color[0] == '\0' ||
-				    ! gdk_color_parse (bg_color,
-					       &color)) {
-					gdk_color_parse ("#000000", &color);
-				}
-				add_color_to_pb (pb, &color);
-			}
-		}
-		if (gdm_config_get_bool (GDM_KEY_BACKGROUND_SCALE_TO_FIT)) {
-			GdkPixbuf *spb = render_scaled_back (pb);
-			g_object_unref (G_OBJECT (pb));
-			pb = spb;
-		}
-
-		/* paranoia */
-		if (pb != NULL) {
-			set_root (pb);
-			g_object_unref (G_OBJECT (pb));
-		}
-	/* Load background color */
-	} else if (bg_type != GDM_BACKGROUND_NONE &&
-	           bg_type != GDM_BACKGROUND_IMAGE) {
-		gdm_common_setup_background_color (bg_color);
-	/* Load default background */
-	} else {
-		gchar *blank_color = g_strdup ("#000000");
-		gdm_common_setup_background_color (blank_color);
-	}
-}
-
 enum {
 	RESPONSE_RESTART,
 	RESPONSE_REBOOT,
@@ -3271,7 +3114,7 @@
 	    gdm_config_reload_bool   (GDM_KEY_BACKGROUND_REMOTE_ONLY_COLOR)) {
 
 		gdm_kill_thingies ();
-		setup_background ();
+		gdm_common_setup_background (FALSE, gdm_wm_screens, gdm_wm_allscreens);
 		back_prog_launch_after_timeout ();
 	}
 
@@ -3385,7 +3228,7 @@
     /* Load the background as early as possible so GDM does not leave  */
     /* the background unfilled.   The cursor should be a watch already */
     /* but just in case */
-    setup_background ();
+    gdm_common_setup_background (FALSE, gdm_wm_screens, gdm_wm_allscreens);
     gdm_common_setup_cursor (GDK_WATCH);
 
     if ( ! DOING_GDM_DEVELOPMENT &&
