2e5fb9
diff -up gdm-2.23.92/daemon/gdm-simple-slave.c.save-root-window gdm-2.23.92/daemon/gdm-simple-slave.c
2e5fb9
--- gdm-2.23.92/daemon/gdm-simple-slave.c.save-root-window	2008-09-03 16:52:53.000000000 -0400
67928d
+++ gdm-2.23.92/daemon/gdm-simple-slave.c	2008-09-19 18:18:50.000000000 -0400
2e5fb9
@@ -825,6 +825,15 @@ setup_server (GdmSimpleSlave *slave)
2e5fb9
 {
2e5fb9
         /* Set the busy cursor */
2e5fb9
         gdm_slave_set_busy_cursor (GDM_SLAVE (slave));
2e5fb9
+
2e5fb9
+        /* The root window has a background that may be useful
2e5fb9
+         * to cross fade or transition from when setting the
2e5fb9
+         * login screen background.  We read it here, and stuff
6a8cf9
+         * it into the standard _XROOTPMAP_ID root window property,
2e5fb9
+         * so gnome-settings-daemon can get at it.
2e5fb9
+         */
2e5fb9
+        gdm_slave_save_root_windows (GDM_SLAVE (slave));
2e5fb9
+
2e5fb9
 }
2e5fb9
 
2e5fb9
 static void
2e5fb9
diff -up gdm-2.23.92/daemon/gdm-slave.c.save-root-window gdm-2.23.92/daemon/gdm-slave.c
2e5fb9
--- gdm-2.23.92/daemon/gdm-slave.c.save-root-window	2008-08-26 15:04:00.000000000 -0400
67928d
+++ gdm-2.23.92/daemon/gdm-slave.c	2008-09-22 11:06:36.000000000 -0400
2e5fb9
@@ -42,6 +42,7 @@
2e5fb9
 #include <dbus dbus-glib-lowlevel.h="">
2e5fb9
 
2e5fb9
 #include <x11 xlib.h=""> /* for Display */
2e5fb9
+#include <x11 xatom.h=""> /* for XA_PIXMAP */
2e5fb9
 #include <x11 cursorfont.h=""> /* for watch cursor */
2e5fb9
 
2e5fb9
 #include "gdm-common.h"
67928d
@@ -341,6 +342,77 @@ gdm_slave_run_script (GdmSlave   *slave,
2e5fb9
         return ret;
2e5fb9
 }
2e5fb9
 
2e5fb9
+static void
2e5fb9
+gdm_slave_save_root_window_of_screen (GdmSlave *slave,
2e5fb9
+                                      Atom      id_atom,
2e5fb9
+                                      int       screen_number)
2e5fb9
+{
2e5fb9
+        Window root_window;
2e5fb9
+        GC gc;
2e5fb9
+        XGCValues values;
2e5fb9
+        Pixmap pixmap;
2e5fb9
+        int width, height, depth;
2e5fb9
+
2e5fb9
+        root_window = RootWindow (slave->priv->server_display,
2e5fb9
+                                  screen_number);
2e5fb9
+
2e5fb9
+        width = DisplayWidth (slave->priv->server_display, screen_number);
2e5fb9
+        height = DisplayHeight (slave->priv->server_display, screen_number);
2e5fb9
+        depth = DefaultDepth (slave->priv->server_display, screen_number);
2e5fb9
+        pixmap = XCreatePixmap (slave->priv->server_display,
2e5fb9
+                                root_window,
2e5fb9
+                                width, height, depth);
2e5fb9
+
2e5fb9
+        values.function = GXcopy;
2e5fb9
+        values.plane_mask = AllPlanes;
2e5fb9
+        values.fill_style = FillSolid;
2e5fb9
+        values.subwindow_mode = IncludeInferiors;
2e5fb9
+
2e5fb9
+        gc = XCreateGC (slave->priv->server_display,
2e5fb9
+                        root_window,
2e5fb9
+                        GCFunction | GCPlaneMask | GCFillStyle | GCSubwindowMode,
2e5fb9
+                        &values);
2e5fb9
+
2e5fb9
+        if (XCopyArea (slave->priv->server_display,
2e5fb9
+                       root_window, pixmap, gc, 0, 0,
2e5fb9
+                       width, height, 0, 0)) {
2e5fb9
+
2e5fb9
+                long pixmap_as_long;
2e5fb9
+
2e5fb9
+                pixmap_as_long = (long) pixmap;
2e5fb9
+
2e5fb9
+                XChangeProperty (slave->priv->server_display,
2e5fb9
+                                 root_window, id_atom, XA_PIXMAP,
2e5fb9
+                                 32, PropModeReplace, (guchar *) &pixmap_as_long,
2e5fb9
+                                 1);
2e5fb9
+
2e5fb9
+        }
2e5fb9
+
2e5fb9
+        XFreeGC (slave->priv->server_display, gc);
2e5fb9
+}
2e5fb9
+
2e5fb9
+void
2e5fb9
+gdm_slave_save_root_windows (GdmSlave *slave)
2e5fb9
+{
2e5fb9
+        int i, number_of_screens;
2e5fb9
+        Atom atom;
2e5fb9
+
2e5fb9
+        number_of_screens = ScreenCount (slave->priv->server_display);
2e5fb9
+
2e5fb9
+        atom = XInternAtom (slave->priv->server_display,
6a8cf9
+                            "_XROOTPMAP_ID", False);
2e5fb9
+
2e5fb9
+        if (atom == 0) {
2e5fb9
+                return;
2e5fb9
+        }
2e5fb9
+
2e5fb9
+        for (i = 0; i < number_of_screens; i++) {
2e5fb9
+                gdm_slave_save_root_window_of_screen (slave, atom, i);
2e5fb9
+        }
67928d
+
67928d
+        XSync (slave->priv->server_display, False);
2e5fb9
+}
2e5fb9
+
2e5fb9
 void
2e5fb9
 gdm_slave_set_busy_cursor (GdmSlave *slave)
2e5fb9
 {
2e5fb9
diff -up gdm-2.23.92/daemon/gdm-slave.h.save-root-window gdm-2.23.92/daemon/gdm-slave.h
2e5fb9
--- gdm-2.23.92/daemon/gdm-slave.h.save-root-window	2008-08-26 15:04:00.000000000 -0400
67928d
+++ gdm-2.23.92/daemon/gdm-slave.h	2008-09-19 18:18:50.000000000 -0400
2e5fb9
@@ -69,6 +69,7 @@ gboolean            gdm_slave_switch_to_
2e5fb9
 
2e5fb9
 gboolean            gdm_slave_connect_to_x11_display (GdmSlave   *slave);
2e5fb9
 void                gdm_slave_set_busy_cursor        (GdmSlave   *slave);
2e5fb9
+void                gdm_slave_save_root_windows      (GdmSlave   *slave);
2e5fb9
 gboolean            gdm_slave_run_script             (GdmSlave   *slave,
2e5fb9
                                                       const char *dir,
2e5fb9
                                                       const char *username);