diff --git a/miext/Makefile.am b/miext/Makefile.am
index f138963..73a6577 100644
--- a/miext/Makefile.am
+++ b/miext/Makefile.am
@@ -5,4 +5,7 @@ endif
 if XQUARTZ
 SUBDIRS += rootless
 endif
+if XWIN
+SUBDIRS += rootless
+endif
 DIST_SUBDIRS = damage shadow cw rootless
diff --git a/miext/rootless/accel/rlAccel.c b/miext/rootless/accel/rlAccel.c
index d62bee7..1fd45cc 100644
--- a/miext/rootless/accel/rlAccel.c
+++ b/miext/rootless/accel/rlAccel.c
@@ -139,7 +139,7 @@ RootlessAccelInit(ScreenPtr pScreen)
 
     s = xalloc(sizeof(rlAccelScreenRec));
     if (!s) return FALSE;
-    RLACCELREC(pScreen) = s;
+    pScreen->devPrivates[rlAccelScreenPrivateIndex].ptr = s;
 
     // Wrap the screen functions we need
     s->CreateGC = pScreen->CreateGC;
diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c
index 356fec7..bb4ec40 100644
--- a/miext/rootless/rootlessScreen.c
+++ b/miext/rootless/rootlessScreen.c
@@ -568,7 +568,7 @@ RootlessAllocatePrivates(ScreenPtr pScreen)
 
     s = xalloc(sizeof(RootlessScreenRec));
     if (! s) return FALSE;
-    SCREENREC(pScreen) = s;
+    pScreen->devPrivates[rootlessScreenPrivateIndex].ptr = s;
 
     s->pixmap_data = NULL;
     s->pixmap_data_size = 0;
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index 30b7daa..24c236c 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -66,7 +66,7 @@ RootlessCreateWindow(WindowPtr pWin)
     Bool result;
     RegionRec saveRoot;
 
-    WINREC(pWin) = NULL;
+    pWin->devPrivates[rootlessWindowPrivateIndex].ptr = NULL;
 
     SCREEN_UNWRAP(pWin->drawable.pScreen, CreateWindow);
 
@@ -107,7 +107,7 @@ RootlessDestroyFrame(WindowPtr pWin, RootlessWindowPtr winRec)
 #endif
 
     xfree(winRec);
-    WINREC(pWin) = NULL;
+    pWin->devPrivates[rootlessWindowPrivateIndex].ptr = NULL;
 }
 
 
@@ -353,7 +353,7 @@ RootlessEnsureFrame(WindowPtr pWin)
     winRec->pixmap = NULL;
     winRec->wid = NULL;
 
-    WINREC(pWin) = winRec;
+    pWin->devPrivates[rootlessWindowPrivateIndex].ptr = winRec;
 
 #ifdef SHAPE
     // Set the frame's shape if the window is shaped
@@ -370,7 +370,7 @@ RootlessEnsureFrame(WindowPtr pWin)
     {
         RL_DEBUG_MSG("implementation failed to create frame!\n");
         xfree(winRec);
-        WINREC(pWin) = NULL;
+        pWin->devPrivates[rootlessWindowPrivateIndex].ptr = NULL;
         return NULL;
     }
 
@@ -1298,8 +1298,8 @@ RootlessReparentWindow(WindowPtr pWin, WindowPtr pPriorParent)
 
         /* Switch the frame record from one to the other. */
 
-        WINREC(pWin) = NULL;
-        WINREC(pTopWin) = winRec;
+        pWin->devPrivates[rootlessWindowPrivateIndex].ptr = NULL;
+        pTopWin->devPrivates[rootlessWindowPrivateIndex].ptr = winRec;
 
         RootlessInitializeFrame(pTopWin, winRec);
         RootlessReshapeFrame(pTopWin);
