Index: gui/gdmlogin.c
===================================================================
--- gui/gdmlogin.c	(révision 4839)
+++ gui/gdmlogin.c	(copie de travail)
@@ -2683,40 +2683,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)
 {
@@ -2819,7 +2785,7 @@
 
 		/* paranoia */
 		if (pb != NULL) {
-			set_root (pb);
+			gdm_common_set_root_background (pb);
 			g_object_unref (G_OBJECT (pb));
 		}
 	/* Load background color */
Index: gui/greeter/greeter_canvas_item.c
===================================================================
--- gui/greeter/greeter_canvas_item.c	(révision 4839)
+++ gui/greeter/greeter_canvas_item.c	(copie de travail)
@@ -469,11 +469,11 @@
 	     * should probably be done in the pam item setup thingie.
 	     * but this is really widget kind of thing.  I dunno where
 	     * this belongs but it's a hack here. */
-	    GtkWidget *menubar = make_menubar ();
+	    item->data.text.menubar = make_menubar ();
 
 	    gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (canvas)),
 				   GNOME_TYPE_CANVAS_WIDGET,
-				   "widget", menubar,
+				   "widget", item->data.text.menubar,
 				   "x", (double)x1,
 				   "y", (double)y1,
 				   "height", (double)rect.height,
@@ -482,7 +482,7 @@
 
 	    greeter_item_register_action_callback ("options_button",
 						   (ActionFunc)greeter_options_handler,
-						   menubar);
+						   item->data.text.menubar);
 	    
 	    /* Here add a tooltip, so that the user knows about F10 */
 	    tooltips = gtk_tooltips_new ();
Index: gui/greeter/greeter_parser.c
===================================================================
--- gui/greeter/greeter_parser.c	(révision 4839)
+++ gui/greeter/greeter_parser.c	(copie de travail)
@@ -1665,6 +1665,7 @@
     GList *items;
     gboolean res;
     xmlChar *type;
+    xmlChar *background;
     GreeterItemInfo *info;
     GreeterItemType item_type;
 
@@ -1766,6 +1767,21 @@
 
 	    if (info->canvasbutton)
 	      button_stack = g_list_remove (button_stack, info);
+
+	    background = xmlGetProp (child, (const xmlChar *) "background");
+	    if G_UNLIKELY (background)
+	      {
+		if (strcmp ((char *) background, "true") == 0)
+		   {
+		      info->background = TRUE;
+		      g_print("found bg %s\n",background);
+		   }
+		else if (strcmp ((char *) background, "false") == 0)
+		   {
+		      info->background = FALSE;
+		   }
+		xmlFree (background);
+	      }
 	    
 	    if G_UNLIKELY (!res)
 	      return FALSE;
@@ -1932,3 +1948,51 @@
 {
   return custom_items;
 }
+
+static void
+hide_item (GreeterItemInfo *info, gpointer user_data)
+{  
+	GnomeCanvasItem *item;
+	gboolean *found_background;
+
+	found_background = user_data;
+
+	if (info)
+       	{
+	     if (info->background)
+	     {
+		     *found_background = TRUE;
+	     }
+	     else {
+		item = info->item;
+	      	if (item) {
+			if (GNOME_IS_CANVAS_WIDGET (item)) {
+				gtk_widget_hide (GNOME_CANVAS_WIDGET (item)->widget);
+			}
+			else
+			gnome_canvas_item_hide (item);
+		}
+		if ((info->item_type == GREETER_ITEM_TYPE_ENTRY) &&
+			(info->data.text.menubar != NULL)) {
+				gtk_widget_hide (info->data.text.menubar);
+			}
+	     }
+
+	g_list_foreach (info->fixed_children, (GFunc) hide_item, user_data);
+	g_list_foreach (info->box_children, (GFunc) hide_item, user_data);
+      }
+}
+
+gboolean 
+greeter_show_only_background (GreeterItemInfo *root_item)
+{
+	gboolean found_background = FALSE;
+
+	hide_item (root_item, &found_background);
+
+	/* ensure root canvas is updated */
+	while (gtk_events_pending ())
+	  gtk_main_iteration ();
+
+	return found_background;
+}
Index: gui/greeter/greeter_item.c
===================================================================
--- gui/greeter/greeter_item.c	(révision 4839)
+++ gui/greeter/greeter_item.c	(copie de travail)
@@ -81,12 +81,14 @@
 
   info->canvasbutton = FALSE;
   info->gtkbutton    = FALSE;
+  info->background   = FALSE;
 
   if (GREETER_ITEM_TYPE_IS_TEXT (info))
     {
       info->data.text.max_width = 0xffff;
       info->data.text.max_screen_percent_width = 90;
       info->data.text.real_max_width = 0;
+      info->data.text.menubar= NULL;
     }
 
   return info;
Index: gui/greeter/greeter_parser.h
===================================================================
--- gui/greeter/greeter_parser.h	(révision 4839)
+++ gui/greeter/greeter_parser.h	(copie de travail)
@@ -43,5 +43,6 @@
 
 GreeterItemInfo *greeter_lookup_id (const char *id);
 const GList *greeter_custom_items (void);
+gboolean greeter_show_only_background (GreeterItemInfo *root_item);
 
 #endif /* __GREETER_PARSER_H__ */
Index: gui/greeter/greeter_item.h
===================================================================
--- gui/greeter/greeter_item.h	(révision 4839)
+++ gui/greeter/greeter_item.h	(copie de travail)
@@ -124,6 +124,9 @@
   /* is a real GTK button (not the fake canvas button) */
   guint gtkbutton:1;
 
+  /* item is used to draw background */
+  guint background:1;
+
   /* geometry handling: */
   guint has_requisition:1;
   GtkRequisition requisition;
@@ -164,6 +167,7 @@
 		  guint16 max_width;
 		  guint8 max_screen_percent_width;
 		  guint16 real_max_width;
+		  GtkWidget *menubar;
 	  } text; /* text and entry (entry only uses fonts) */
 
 #define GREETER_ITEM_TYPE_IS_PIXMAP(info) ((info)->item_type == GREETER_ITEM_TYPE_PIXMAP || (info)->item_type == GREETER_ITEM_TYPE_SVG)
Index: gui/greeter/greeter.dtd
===================================================================
--- gui/greeter/greeter.dtd	(révision 4839)
+++ gui/greeter/greeter.dtd	(copie de travail)
@@ -25,6 +25,7 @@
 	type (rect | entry | pixmap | label | svg | rect | list) #REQUIRED
 	id CDATA #IMPLIED
 	button (true | false) #IMPLIED
+	background (true | false) #IMPLIED
 >
 <!ATTLIST pos
 	x CDATA #IMPLIED
Index: gui/greeter/greeter_item_pam.c
===================================================================
--- gui/greeter/greeter_item_pam.c	(révision 4839)
+++ gui/greeter/greeter_item_pam.c	(copie de travail)
@@ -50,7 +50,7 @@
 extern GtkButton *gtk_ok_button;
 extern GtkButton *gtk_start_again_button;
 
-static gboolean
+static void
 greeter_item_pam_error_set (gboolean display)
 {
   GreeterItemInfo *info;
@@ -70,8 +70,6 @@
       else
           gnome_canvas_item_hide (item);
     }
-
-  return TRUE;
 }
 
 void
Index: gui/greeter/greeter.c
===================================================================
--- gui/greeter/greeter.c	(révision 4839)
+++ gui/greeter/greeter.c	(copie de travail)
@@ -79,6 +79,7 @@
 
 /* FIXME: hack */
 GreeterItemInfo *welcome_string_info = NULL;
+GreeterItemInfo *root = NULL;
 
 extern gboolean session_dir_whacked_out;
 extern gboolean require_quarter;
@@ -449,6 +450,18 @@
 
 	gdk_flush ();
 
+	if (greeter_show_only_background (root)) {
+		GdkPixbuf *background;
+		int width, height;
+
+		gtk_window_get_size (GTK_WINDOW (window), &width, &height);
+		background = gdk_pixbuf_get_from_drawable (NULL, gtk_widget_get_root_window(window), NULL, 0, 0, 0, 0 ,width, height);
+		if (background) {
+			gdm_common_set_root_background (background);
+			g_object_unref (background);
+		}
+	}
+
 	printf ("%c\n", STX);
 	fflush (stdout);
 
@@ -1181,7 +1194,6 @@
   sigset_t mask;
   GIOChannel *ctrlch;
   GError *error;
-  GreeterItemInfo *root;
   char *theme_file;
   char *theme_dir;
   gchar *gdm_graphical_theme;
Index: gui/gdmcommon.c
===================================================================
--- gui/gdmcommon.c	(révision 4839)
+++ gui/gdmcommon.c	(copie de travail)
@@ -528,6 +528,42 @@
 		}
 }
 
+void
+gdm_common_set_root_background (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 ();
+}
+
+
+
 gchar *
 gdm_common_get_welcomemsg (void)
 {
Index: gui/gdmcommon.h
===================================================================
--- gui/gdmcommon.h	(révision 4839)
+++ gui/gdmcommon.h	(copie de travail)
@@ -64,6 +64,7 @@
 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_set_root_background    (GdkPixbuf *pb);
 gchar*	  gdm_common_get_welcomemsg	    (void);
 void	  gdm_common_pre_fetch_launch       (void);
 void      gdm_common_atspi_launch           (void);
