--- gdm-2.29.6/daemon/gdm-welcome-session.c-orig	2010-02-15 14:41:57.742767136 -0600
+++ gdm-2.29.6/daemon/gdm-welcome-session.c	2010-02-15 14:42:46.954951127 -0600
@@ -454,6 +454,7 @@ get_welcome_environment (GdmWelcomeSessi
                 g_free (source_path);
         }
 
+        g_hash_table_insert (hash, g_strdup ("WINDOWPATH"), g_strdup (g_getenv ("WINDOWPATH")));
         g_hash_table_insert (hash, g_strdup ("PATH"), g_strdup (g_getenv ("PATH")));
 
         g_hash_table_insert (hash, g_strdup ("RUNNING_UNDER_GDM"), g_strdup ("true"));
--- gdm-2.29.6/daemon/gdm-slave.c-orig	2010-02-15 14:29:16.967865659 -0600
+++ gdm-2.29.6/daemon/gdm-slave.c	2010-02-15 14:50:36.533735517 -0600
@@ -44,6 +44,7 @@
 
 #include <X11/Xlib.h> /* for Display */
 #include <X11/cursorfont.h> /* for watch cursor */
+#include <X11/Xatom.h>
 
 #include "gdm-common.h"
 
@@ -90,6 +91,7 @@ struct GdmSlavePrivate
         char            *display_x11_authority_file;
         char            *parent_display_name;
         char            *parent_display_x11_authority_file;
+        char            *windowpath;
 
         GArray          *display_x11_cookie;
 
@@ -369,6 +371,83 @@ gdm_slave_set_busy_cursor (GdmSlave *sla
         }
 }
 
+static void
+gdm_slave_window_path (GdmSlave *slave)
+{
+        /* setting WINDOWPATH for clients */
+        Atom prop;
+        Atom actualtype;
+        int actualformat;
+        unsigned long nitems;
+        unsigned long bytes_after;
+        unsigned char *buf;
+        const char *windowpath;
+        char *newwindowpath;
+        unsigned long num;
+        char nums[10];
+        int numn;
+
+        prop = XInternAtom (slave->priv->server_display, "XFree86_VT", False);
+        if (prop == None) {
+                g_debug ("no XFree86_VT atom\n");
+                return;
+        }
+        if (XGetWindowProperty (slave->priv->server_display,
+                DefaultRootWindow (slave->priv->server_display), prop, 0, 1, 
+                False, AnyPropertyType, &actualtype, &actualformat, 
+                &nitems, &bytes_after, &buf)) {
+                g_debug ("no XFree86_VT property\n");
+                return;
+        }
+
+        if (nitems != 1) {
+                g_debug ("%lu items in XFree86_VT property!\n", nitems);
+                XFree (buf);
+                return;
+        }
+
+        switch (actualtype) {
+        case XA_CARDINAL:
+        case XA_INTEGER:
+        case XA_WINDOW:
+                switch (actualformat) {
+                case  8:
+                        num = (*(uint8_t  *)(void *)buf);
+                        break;
+                case 16:
+                        num = (*(uint16_t *)(void *)buf);
+                        break;
+                case 32:
+                        num = (*(uint32_t *)(void *)buf);
+                        break;
+                default:
+                        g_debug ("format %d in XFree86_VT property!\n", actualformat);
+                        XFree (buf);
+                        return;
+                }
+                break;
+        default:
+                g_debug ("type %lx in XFree86_VT property!\n", actualtype);
+                XFree (buf);
+                return;
+        }
+        XFree (buf);
+
+        windowpath = getenv ("WINDOWPATH");
+        numn = snprintf (nums, sizeof (nums), "%lu", num);
+        if (!windowpath) {
+                newwindowpath = malloc (numn + 1);
+                sprintf (newwindowpath, "%s", nums);
+        } else {
+                newwindowpath = malloc (strlen (windowpath) + 1 + numn + 1);
+                sprintf (newwindowpath, "%s:%s", windowpath, nums);
+        }
+
+        slave->priv->windowpath = newwindowpath;
+
+        g_setenv ("WINDOWPATH", newwindowpath, TRUE);
+}
+
 gboolean
 gdm_slave_connect_to_x11_display (GdmSlave *slave)
 {
@@ -439,6 +518,10 @@ gdm_slave_connect_to_x11_display (GdmSla
                 ret = TRUE;
         }
 
+        if (ret) {
+                gdm_slave_window_path (slave);
+        }
+
         return ret;
 }
 
@@ -1762,6 +1845,7 @@ gdm_slave_finalize (GObject *object)
         g_free (slave->priv->display_x11_authority_file);
         g_free (slave->priv->parent_display_name);
         g_free (slave->priv->parent_display_x11_authority_file);
+        g_free (slave->priv->windowpath);
         g_array_free (slave->priv->display_x11_cookie, TRUE);
 
         G_OBJECT_CLASS (gdm_slave_parent_class)->finalize (object);
--- gdm-2.29.6/daemon/gdm-session-direct.c-orig	2010-02-15 14:39:33.970696184 -0600
+++ gdm-2.29.6/daemon/gdm-session-direct.c	2010-02-15 14:45:15.458240748 -0600
@@ -2113,6 +2113,10 @@ setup_session_environment (GdmSessionDir
                                                              session->priv->user_x11_authority_file);
         }
 
+        gdm_session_direct_set_environment_variable (session,
+                                                     "WINDOWPATH",
+                                                     g_getenv ("WINDOWPATH"));
+
         passwd_entry = getpwnam (session->priv->selected_user);
         if (passwd_entry != NULL && passwd_entry->pw_uid == 0)
                 path_str = gdm_read_default ("SUPATH=");
