Index: xorg-server-1.8.99.906/hw/vnc/cutpaste.c
===================================================================
--- xorg-server-1.8.99.906.orig/hw/vnc/cutpaste.c
+++ xorg-server-1.8.99.906/hw/vnc/cutpaste.c
@@ -54,7 +54,7 @@ rfbSetXCutText(char *str, int len)
     Selection *pSel;
 
     inSetXCutText = TRUE;
-    ChangeWindowProperty(WindowTable[0], XA_CUT_BUFFER0, XA_STRING,
+    ChangeWindowProperty(screenInfo.screens[0]->root, XA_CUT_BUFFER0, XA_STRING,
 			 8, PropModeReplace, len,
 			 (pointer)str, TRUE);
     
Index: xorg-server-1.8.99.906/hw/vnc/dispcur.c
===================================================================
--- xorg-server-1.8.99.906.orig/hw/vnc/dispcur.c
+++ xorg-server-1.8.99.906/hw/vnc/dispcur.c
@@ -340,7 +340,7 @@ rfbDCRealize (ScreenPtr pScreen, CursorP
 			   0, 0, pCursor->bits->width, pCursor->bits->height,
  			   0, XYPixmap, (char *)pCursor->bits->source);
     gcvals[0] = GXand;
-    ChangeGC (pGC, GCFunction, gcvals);
+    ChangeGCXIDs (NullClient, pGC, GCFunction, gcvals);
     ValidateGC ((DrawablePtr)pPriv->sourceBits, pGC);
     (*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1,
 			   0, 0, pCursor->bits->width, pCursor->bits->height,
@@ -348,13 +348,13 @@ rfbDCRealize (ScreenPtr pScreen, CursorP
 
     /* mask bits -- pCursor->mask & ~pCursor->source */
     gcvals[0] = GXcopy;
-    ChangeGC (pGC, GCFunction, gcvals);
+    ChangeGCXIDs (NullClient, pGC, GCFunction, gcvals);
     ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
     (*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
 			   0, 0, pCursor->bits->width, pCursor->bits->height,
  			   0, XYPixmap, (char *)pCursor->bits->mask);
     gcvals[0] = GXandInverted;
-    ChangeGC (pGC, GCFunction, gcvals);
+    ChangeGCXIDs (NullClient, pGC, GCFunction, gcvals);
     ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
     (*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
 			   0, 0, pCursor->bits->width, pCursor->bits->height,
@@ -396,7 +396,7 @@ rfbDCPutBits (DrawablePtr pDrawable, rfb
     if (sourceGC->fgPixel != source)
     {
 	gcvals[0] = source;
-	DoChangeGC (sourceGC, GCForeground, gcvals, 0);
+	ChangeGCXIDs (NullClient, sourceGC, GCForeground, gcvals);
     }
     if (sourceGC->serialNumber != pDrawable->serialNumber)
 	ValidateGC (pDrawable, sourceGC);
@@ -404,7 +404,7 @@ rfbDCPutBits (DrawablePtr pDrawable, rfb
     if (maskGC->fgPixel != mask)
     {
 	gcvals[0] = mask;
-	DoChangeGC (maskGC, GCForeground, gcvals, 0);
+	ChangeGCXIDs (NullClient, maskGC, GCForeground, gcvals);
     }
     if (maskGC->serialNumber != pDrawable->serialNumber)
 	ValidateGC (pDrawable, maskGC);
@@ -451,7 +451,7 @@ rfbDCPutUpCursor (pScreen, pCursor, x, y
     }
     pScreenPriv = (rfbDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
 						  rfbDCScreenKey);
-    pWin = WindowTable[pScreen->myNum];
+    pWin = pScreen->root;
 #ifdef ARGB_CURSOR
     if (pPriv->pPicture)
     {
@@ -498,7 +498,7 @@ rfbDCSaveUnderCursor (pScreen, x, y, w, 
     pScreenPriv = (rfbDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
 						  rfbDCScreenKey);
     pSave = pScreenPriv->pSave;
-    pWin = WindowTable[pScreen->myNum];
+    pWin = pScreen->root;
     if (!pSave || pSave->drawable.width < w || pSave->drawable.height < h)
     {
 	if (pSave)
@@ -531,7 +531,7 @@ rfbDCRestoreUnderCursor (pScreen, x, y, 
     pScreenPriv = (rfbDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
 						  rfbDCScreenKey);
     pSave = pScreenPriv->pSave;
-    pWin = WindowTable[pScreen->myNum];
+    pWin = pScreen->root;
     if (!pSave)
 	return FALSE;
     if (!EnsureGC(pScreenPriv->pRestoreGC, pWin))
@@ -558,7 +558,7 @@ rfbDCChangeSave (pScreen, x, y, w, h, dx
     pScreenPriv = (rfbDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
 						  rfbDCScreenKey);
     pSave = pScreenPriv->pSave;
-    pWin = WindowTable[pScreen->myNum];
+    pWin = pScreen->root;
     /*
      * restore the bits which are about to get trashed
      */
@@ -702,7 +702,7 @@ rfbDCMoveCursor (pScreen, pCursor, x, y,
     }
     pScreenPriv = (rfbDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
 						  rfbDCScreenKey);
-    pWin = WindowTable[pScreen->myNum];
+    pWin = pScreen->root;
     pTemp = pScreenPriv->pTemp;
     if (!pTemp ||
 	pTemp->drawable.width != pScreenPriv->pSave->drawable.width ||
Index: xorg-server-1.8.99.906/hw/vnc/draw.c
===================================================================
--- xorg-server-1.8.99.906.orig/hw/vnc/draw.c
+++ xorg-server-1.8.99.906/hw/vnc/draw.c
@@ -217,8 +217,6 @@ rfbCloseScreen (int i, ScreenPtr pScreen
 
     pScreen->CloseScreen = pVNC->CloseScreen;
     pScreen->CreateGC = pVNC->CreateGC;
-    pScreen->PaintWindowBackground = pVNC->PaintWindowBackground;
-    pScreen->PaintWindowBorder = pVNC->PaintWindowBorder;
     pScreen->CopyWindow = pVNC->CopyWindow;
     pScreen->ClearToBackground = pVNC->ClearToBackground;
     pScreen->RestoreAreas = pVNC->RestoreAreas;
@@ -252,7 +250,7 @@ rfbEnableDisableFBAccess (int index, Boo
      * control even when switched away. 
      */
     if (!enable) {
-	WindowPtr pWin = WindowTable[index];
+	WindowPtr pWin = pScrn->pScreen->root;
     	ScreenPtr pScreen = pWin->drawable.pScreen;
     	GCPtr pGC;
     	xRectangle rect;
@@ -268,7 +266,7 @@ rfbEnableDisableFBAccess (int index, Boo
 	    CARD32 attributes[2];
 	    attributes[0] = pScreen->whitePixel;
 	    attributes[1] = pScreen->blackPixel;
-	    (void)ChangeGC(pGC, GCForeground | GCBackground, attributes);
+	    (void)ChangeGCXIDs(NullClient, pGC, GCForeground | GCBackground, attributes);
 
 	    ValidateGC((DrawablePtr)pWin, pGC);
 
@@ -320,7 +318,7 @@ rfbCreateGC (GCPtr pGC)
 /*
  * PaintWindowBackground - the region being modified is just the given region.
  */
-
+#if 0
 void
 rfbPaintWindowBackground (WindowPtr pWin, RegionPtr pRegion, int what)
 {
@@ -356,6 +354,7 @@ rfbPaintWindowBorder (WindowPtr pWin, Re
 
     SCREEN_EPILOGUE(PaintWindowBorder,rfbPaintWindowBorder);
 }
+#endif
 
 #ifdef CHROMIUM
 Bool
Index: xorg-server-1.8.99.906/hw/vnc/init.c
===================================================================
--- xorg-server-1.8.99.906.orig/hw/vnc/init.c
+++ xorg-server-1.8.99.906/hw/vnc/init.c
@@ -670,8 +670,6 @@ rfbScreenInit(index, pScreen, argc, argv
     prfb->CloseScreen = pScreen->CloseScreen;
     prfb->WakeupHandler = pScreen->WakeupHandler;
     prfb->CreateGC = pScreen->CreateGC;
-    prfb->PaintWindowBackground = pScreen->PaintWindowBackground;
-    prfb->PaintWindowBorder = pScreen->PaintWindowBorder;
     prfb->CopyWindow = pScreen->CopyWindow;
     prfb->ClearToBackground = pScreen->ClearToBackground;
     prfb->RestoreAreas = pScreen->RestoreAreas;
@@ -691,8 +689,6 @@ rfbScreenInit(index, pScreen, argc, argv
     pScreen->CloseScreen = rfbCloseScreen;
     pScreen->WakeupHandler = rfbWakeupHandler;
     pScreen->CreateGC = rfbCreateGC;
-    pScreen->PaintWindowBackground = rfbPaintWindowBackground;
-    pScreen->PaintWindowBorder = rfbPaintWindowBorder;
     pScreen->CopyWindow = rfbCopyWindow;
     pScreen->ClearToBackground = rfbClearToBackground;
     pScreen->RestoreAreas = rfbRestoreAreas;
@@ -1047,7 +1043,8 @@ void ddxInitGlobals(void)
 }
 
 int
-NewInputDeviceRequest(InputOption *options, DeviceIntPtr *pdev)
+NewInputDeviceRequest(InputOption *options, InputAttributes *attrs,
+                      DeviceIntPtr *pdev)
 {
     return BadValue;
 }
@@ -1057,6 +1054,10 @@ DeleteInputDeviceRequest(DeviceIntPtr de
 {
 }
 
+void
+CloseInput (void)
+{
+}
 
 /*
  * rfbLog prints a time-stamped message to the log file (stderr).
Index: xorg-server-1.8.99.906/hw/vnc/rfb.h
===================================================================
--- xorg-server-1.8.99.906.orig/hw/vnc/rfb.h
+++ xorg-server-1.8.99.906/hw/vnc/rfb.h
@@ -81,7 +81,8 @@
 #define UPDATE_BUF_SIZE 30000
 
 extern DevPrivateKey VNCScreenKey;
-extern DevPrivateKey rfbGCKey;
+extern DevPrivateKeyRec rfbGCKeyRec;
+#define rfbGCKey (&rfbGCKeyRec)
 
 #if XFREE86VNC || defined(DMXVNC)
 #include "vncint.h"
@@ -189,8 +190,6 @@ typedef struct
 
     CloseScreenProcPtr			CloseScreen;
     CreateGCProcPtr			CreateGC;
-    PaintWindowBackgroundProcPtr	PaintWindowBackground;
-    PaintWindowBorderProcPtr		PaintWindowBorder;
     CopyWindowProcPtr			CopyWindow;
     ClearToBackgroundProcPtr		ClearToBackground;
     RestoreAreasProcPtr			RestoreAreas;
Index: xorg-server-1.8.99.906/hw/vnc/rfbserver.c
===================================================================
--- xorg-server-1.8.99.906.orig/hw/vnc/rfbserver.c
+++ xorg-server-1.8.99.906/hw/vnc/rfbserver.c
@@ -82,7 +82,7 @@ void
 rfbRootPropertyChange(ScreenPtr pScreen)
 {
     PropertyPtr pProp;
-    WindowPtr pWin = WindowTable[pScreen->myNum];
+    WindowPtr pWin = pScreen->root;
 
     pProp = wUserProps (pWin);
 
@@ -1068,7 +1068,7 @@ rfbProcessClientNormalMessage(cl)
     		    GenerateVncChromiumConnectedEvent(cl->sock);
                     if (enc == rfbEncodingChromium) {
                         /* Generate exposures for all windows */
-                        WindowPtr pWin = WindowTable[cl->pScreen->myNum];
+                        WindowPtr pWin = cl->pScreen->root;
                         rfbSetClip(pWin, 1);
                     }
                     else {
@@ -1866,13 +1866,13 @@ rfbSendSetColourMapEntries(cl, firstColo
 
     /* PseudoColor */
 #if XFREE86VNC
-    if (miInstalledMaps[cl->pScreen->myNum]->class == PseudoColor) {
+    if (GetInstalledmiColormap(cl->pScreen)->class == PseudoColor) {
 #else
     if (pVNC->rfbInstalledColormap->class == PseudoColor) {
 #endif
       scme->firstColour = Swap16IfLE(firstColour);
 #if XFREE86VNC
-      pent = (EntryPtr)&miInstalledMaps[cl->pScreen->myNum]->red[firstColour];
+      pent = (EntryPtr)&GetInstalledmiColormap(cl->pScreen)->red[firstColour];
 #else
       pent = (EntryPtr)&pVNC->rfbInstalledColormap->red[firstColour];
 #endif
@@ -1894,12 +1894,12 @@ rfbSendSetColourMapEntries(cl, firstColo
 
       /* Break the DirectColor pixel into its r/g/b components */
 #if XFREE86VNC
-      redPart   = (firstColour & miInstalledMaps[cl->pScreen->myNum]->pVisual->redMask)
-		  >> miInstalledMaps[cl->pScreen->myNum]->pVisual->offsetRed;
-      greenPart = (firstColour & miInstalledMaps[cl->pScreen->myNum]->pVisual->greenMask)
-		  >> miInstalledMaps[cl->pScreen->myNum]->pVisual->offsetGreen;
-      bluePart  = (firstColour & miInstalledMaps[cl->pScreen->myNum]->pVisual->blueMask)
-		  >> miInstalledMaps[cl->pScreen->myNum]->pVisual->offsetBlue;
+      redPart   = (firstColour & GetInstalledmiColormap(cl->pScreen)->pVisual->redMask)
+		  >> GetInstalledmiColormap(cl->pScreen)->pVisual->offsetRed;
+      greenPart = (firstColour & GetInstalledmiColormap(cl->pScreen)->pVisual->greenMask)
+		  >> GetInstalledmiColormap(cl->pScreen)->pVisual->offsetGreen;
+      bluePart  = (firstColour & GetInstalledmiColormap(cl->pScreen)->pVisual->blueMask)
+		  >> GetInstalledmiColormap(cl->pScreen)->pVisual->offsetBlue;
 #else
       redPart   = (firstColour & pVNC->rfbInstalledColormap->pVisual->redMask)
 		  >> pVNC->rfbInstalledColormap->pVisual->offsetRed;
@@ -1918,9 +1918,9 @@ rfbSendSetColourMapEntries(cl, firstColo
       scme->firstColour = Swap16IfLE((greenPart << 8) | bluePart);
 
 #if XFREE86VNC
-      redEntry   = (EntryPtr)&miInstalledMaps[cl->pScreen->myNum]->red[redPart];
-      greenEntry = (EntryPtr)&miInstalledMaps[cl->pScreen->myNum]->green[greenPart];
-      blueEntry  = (EntryPtr)&miInstalledMaps[cl->pScreen->myNum]->blue[bluePart];
+      redEntry   = (EntryPtr)&GetInstalledmiColormap(cl->pScreen)->red[redPart];
+      greenEntry = (EntryPtr)&GetInstalledmiColormap(cl->pScreen)->green[greenPart];
+      blueEntry  = (EntryPtr)&GetInstalledmiColormap(cl->pScreen)->blue[bluePart];
 #else
       redEntry   = (EntryPtr)&pVNC->rfbInstalledColormap->red[redPart];
       greenEntry = (EntryPtr)&pVNC->rfbInstalledColormap->green[greenPart];
Index: xorg-server-1.8.99.906/hw/vnc/sprite.c
===================================================================
--- xorg-server-1.8.99.906.orig/hw/vnc/sprite.c
+++ xorg-server-1.8.99.906/hw/vnc/sprite.c
@@ -112,8 +112,8 @@ static void	    rfbSpriteSaveDoomedAreas
 static RegionPtr    rfbSpriteRestoreAreas(WindowPtr pWin, RegionPtr pRgnExposed);
 static void	    rfbSpriteComputeSaved(ScreenPtr pScreen);
 
-static int rfbSpriteScreenKeyStore;
-static DevPrivateKey rfbSpriteScreenKey = &rfbSpriteScreenKeyStore;
+static DevPrivateKeyRec rfbSpriteScreenKeyRec;
+#define rfbSpriteScreenKey (&rfbSpriteScreenKeyRec)
 
 #define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = \
    ((rfbSpriteScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, \
@@ -145,8 +145,8 @@ static GCFuncs	rfbSpriteGCFuncs = {
     rfbSpriteCopyClip,
 };
 
-static int rfbSpriteGCKeyStore;
-static DevPrivateKey rfbSpriteGCKey = &rfbSpriteGCKeyStore;
+static DevPrivateKeyRec rfbSpriteGCKeyRec;
+#define rfbSpriteGCKey (&rfbSpriteGCKeyRec)
 
 #define GC_FUNC_PROLOGUE(pGC)					\
     rfbSpriteGCPtr   pGCPriv =					\
@@ -329,7 +329,7 @@ rfbSpriteInitialize (pScreen, cursorFunc
     rfbSpriteScreenPtr	pPriv;
     VisualPtr		pVisual;
     
-    if (!dixRequestPrivate(rfbSpriteGCKey, sizeof(rfbSpriteGCRec)))
+    if (!dixRegisterPrivateKey(rfbSpriteGCKey, PRIVATE_CLIENT, sizeof(rfbSpriteGCRec)))
 	return FALSE;
 
     pPriv = (rfbSpriteScreenPtr) xalloc (sizeof (rfbSpriteScreenRec));
@@ -357,8 +357,6 @@ rfbSpriteInitialize (pScreen, cursorFunc
     pPriv->StoreColors = pScreen->StoreColors;
     pPriv->DisplayCursor = pScreen->DisplayCursor;
 
-    pPriv->PaintWindowBackground = pScreen->PaintWindowBackground;
-    pPriv->PaintWindowBorder = pScreen->PaintWindowBorder;
     pPriv->CopyWindow = pScreen->CopyWindow;
     pPriv->ClearToBackground = pScreen->ClearToBackground;
 
@@ -393,8 +391,6 @@ rfbSpriteInitialize (pScreen, cursorFunc
     pScreen->InstallColormap = rfbSpriteInstallColormap;
     pScreen->StoreColors = rfbSpriteStoreColors;
 
-    pScreen->PaintWindowBackground = rfbSpritePaintWindowBackground;
-    pScreen->PaintWindowBorder = rfbSpritePaintWindowBorder;
     pScreen->CopyWindow = rfbSpriteCopyWindow;
     pScreen->ClearToBackground = rfbSpriteClearToBackground;
 
@@ -435,8 +431,6 @@ rfbSpriteCloseScreen (i, pScreen)
     pScreen->InstallColormap = pScreenPriv->InstallColormap;
     pScreen->StoreColors = pScreenPriv->StoreColors;
 
-    pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground;
-    pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder;
     pScreen->CopyWindow = pScreenPriv->CopyWindow;
     pScreen->ClearToBackground = pScreenPriv->ClearToBackground;
 
@@ -805,6 +799,7 @@ rfbSpriteRestoreAreas (pWin, prgnExposed
     return result;
 }
 
+#if 0
 /*
  * Window wrappers
  */
@@ -866,6 +861,7 @@ rfbSpritePaintWindowBorder (pWin, pRegio
 
     SCREEN_EPILOGUE (pScreen, PaintWindowBorder, rfbSpritePaintWindowBorder);
 }
+#endif
 
 static void
 rfbSpriteCopyWindow (pWin, ptOldOrg, pRegion)
Index: xorg-server-1.8.99.906/hw/vnc/spritest.h
===================================================================
--- xorg-server-1.8.99.906.orig/hw/vnc/spritest.h
+++ xorg-server-1.8.99.906/hw/vnc/spritest.h
@@ -70,8 +70,6 @@ typedef struct {
     ScreenBlockHandlerProcPtr		BlockHandler;
     InstallColormapProcPtr		InstallColormap;
     StoreColorsProcPtr			StoreColors;
-    PaintWindowBackgroundProcPtr	PaintWindowBackground;
-    PaintWindowBorderProcPtr		PaintWindowBorder;
     CopyWindowProcPtr			CopyWindow;
     ClearToBackgroundProcPtr		ClearToBackground;
     SaveDoomedAreasProcPtr		SaveDoomedAreas;
Index: xorg-server-1.8.99.906/hw/vnc/tableinitcmtemplate.c
===================================================================
--- xorg-server-1.8.99.906.orig/hw/vnc/tableinitcmtemplate.c
+++ xorg-server-1.8.99.906/hw/vnc/tableinitcmtemplate.c
@@ -61,7 +61,7 @@ rfbInitColourMapSingleTableOUT (ScreenPt
     t = (OUT_T *)*table;
 
 #if XFREE86VNC
-    pent = (EntryPtr)&miInstalledMaps[pScreen->myNum]->red[0];
+    pent = (EntryPtr)&GetInstalledmiColormap(pScreen)->red[0];
 #else
     pent = (EntryPtr)&pVNC->rfbInstalledColormap->red[0];
 #endif
Index: xorg-server-1.8.99.906/hw/vnc/tabletranstemplate.c
===================================================================
--- xorg-server-1.8.99.906.orig/hw/vnc/tabletranstemplate.c
+++ xorg-server-1.8.99.906/hw/vnc/tabletranstemplate.c
@@ -67,7 +67,7 @@ rfbTranslateWithSingleTableINtoOUT (Scre
     OUT_T *op = (OUT_T *)optr;
     OUT_T *opLineEnd;
     OUT_T *t = (OUT_T *)table;
-    DrawablePtr pDraw = (DrawablePtr)WindowTable[pScreen->myNum];
+    DrawablePtr pDraw = (DrawablePtr)pScreen->root;
     int truewidth = PixmapBytePad(width, in->bitsPerPixel);
     unsigned char *iptr = malloc(truewidth * height * in->bitsPerPixel / 8);
     int ipextra = truewidth - width;
@@ -107,7 +107,7 @@ rfbTranslateWithRGBTablesINtoOUT (Screen
     OUT_T *redTable = (OUT_T *)table;
     OUT_T *greenTable = redTable + in->redMax + 1;
     OUT_T *blueTable = greenTable + in->greenMax + 1;
-    DrawablePtr pDraw = (DrawablePtr)WindowTable[pScreen->myNum];
+    DrawablePtr pDraw = (DrawablePtr)pScreen->root;
     int truewidth = PixmapBytePad(width, in->bitsPerPixel);
     unsigned char *iptr = malloc(truewidth * height * in->bitsPerPixel / 8);
     int ipextra = truewidth - width;
Index: xorg-server-1.8.99.906/hw/vnc/translate.c
===================================================================
--- xorg-server-1.8.99.906.orig/hw/vnc/translate.c
+++ xorg-server-1.8.99.906/hw/vnc/translate.c
@@ -167,7 +167,7 @@ rfbTranslateNone(ScreenPtr pScreen, char
 		 int width, int height, int x, int y)
 {
     VNCSCREENPTR(pScreen);
-    DrawablePtr pDraw = (DrawablePtr)WindowTable[pScreen->myNum];
+    DrawablePtr pDraw = (DrawablePtr)pScreen->root;
     int truewidth = PixmapBytePad(width, in->bitsPerPixel);
 
     if ((x + width > pVNC->width) || truewidth != width * in->bitsPerPixel / 8) {
@@ -227,7 +227,7 @@ rfbSetTranslateFunction(cl)
     if (!pVNC->rfbServerFormat.trueColour &&
 	(pVNC->rfbServerFormat.bitsPerPixel != 8) &&
 #if XFREE86VNC
-	(miInstalledMaps[cl->pScreen->myNum]->class == PseudoColor)) {
+	(GetInstalledmiColormap(cl->pScreen)->class == PseudoColor)) {
 #else
 	(pVNC->rfbInstalledColormap->class == PseudoColor)) {
 #endif
@@ -241,7 +241,7 @@ rfbSetTranslateFunction(cl)
     if (!cl->format.trueColour &&
 	(cl->format.bitsPerPixel != 8) &&
 #if XFREE86VNC
-	(miInstalledMaps[cl->pScreen->myNum]->class == PseudoColor)) {
+	(GetInstalledmiColormap(cl->pScreen)->class == PseudoColor)) {
 #else
 	(pVNC->rfbInstalledColormap->class == PseudoColor) ) {
 #endif
@@ -265,7 +265,7 @@ rfbSetTranslateFunction(cl)
 	    /* colour map -> colour map */
 
 #if XFREE86VNC
-	    if (miInstalledMaps[cl->pScreen->myNum]->class == DirectColor) {
+	    if (GetInstalledmiColormap(cl->pScreen)->class == DirectColor) {
 #else
 	    if (pVNC->rfbInstalledColormap->class == DirectColor) {
 #endif
@@ -433,7 +433,7 @@ rfbSetClientColourMap(cl, firstColour, n
 
     if (nColours == 0) {
 #if XFREE86VNC
-	nColours = miInstalledMaps[cl->pScreen->myNum]->pVisual->ColormapEntries;
+	nColours = GetInstalledmiColormap(cl->pScreen)->pVisual->ColormapEntries;
 #else
 	nColours = pVNC->rfbInstalledColormap->pVisual->ColormapEntries;
 #endif
Index: xorg-server-1.8.99.906/hw/vnc/vncext.c
===================================================================
--- xorg-server-1.8.99.906.orig/hw/vnc/vncext.c
+++ xorg-server-1.8.99.906/hw/vnc/vncext.c
@@ -36,9 +36,10 @@
 #include <arpa/inet.h>
 #include <netdb.h>
 
-static int vncCreateScreenResourcesKeyStore, rfbGCKeyStore;
-DevPrivateKey vncCreateScreenResourcesKey = &vncCreateScreenResourcesKeyStore;
-DevPrivateKey rfbGCKey = &rfbGCKeyStore;
+DevPrivateKeyRec vncCreateScreenResourcesKeyRec;
+#define vncCreateScreenResourcesKey (&vncCreateScreenResourcesKeyRec)
+DevPrivateKeyRec rfbGCKeyRec;
+#define rfbGCKey (&rfbGCKeyRec)
 
 int VncSelectNotify(ClientPtr client, BOOL onoff);
 void VncExtensionInit(void);
@@ -140,7 +141,7 @@ VncSaveClientRecord(ClientPtr client)
     if (rec) {
         rec->client = client;
         rec->fakeID = FakeClientID(client->index);
-        rec->res = CreateNewResourceType(VncDestroyClientResourceCallback);
+        rec->res = CreateNewResourceType(VncDestroyClientResourceCallback, "FakeClient");
         if (!AddResource(rec->fakeID, rec->res, rec)) {
             xfree(rec);
         }
@@ -763,7 +764,7 @@ VncExtensionInit(void)
 	vncExtGeneration = serverGeneration;
 
 	// no allocation needed for screen privates
-	if (!dixRequestPrivate(rfbGCKey, sizeof(rfbGCRec)))
+	if (!dixRegisterPrivateKey(rfbGCKey, PRIVATE_CLIENT, sizeof(rfbGCRec)))
 	    return;
 
 #if XFREE86VNC
Index: xorg-server-1.8.99.906/hw/xfree86/vnc/vncInit.c
===================================================================
--- xorg-server-1.8.99.906.orig/hw/xfree86/vnc/vncInit.c
+++ xorg-server-1.8.99.906/hw/xfree86/vnc/vncInit.c
@@ -286,8 +286,6 @@ VNCInit(ScreenPtr pScreen, unsigned char
 
     pScreenPriv->CloseScreen = pScreen->CloseScreen;
     pScreenPriv->CreateGC = pScreen->CreateGC;
-    pScreenPriv->PaintWindowBackground = pScreen->PaintWindowBackground;
-    pScreenPriv->PaintWindowBorder = pScreen->PaintWindowBorder;
     pScreenPriv->CopyWindow = pScreen->CopyWindow;
     pScreenPriv->ClearToBackground = pScreen->ClearToBackground;
     pScreenPriv->RestoreAreas = pScreen->RestoreAreas;
@@ -313,8 +311,6 @@ VNCInit(ScreenPtr pScreen, unsigned char
 #endif
     pScreen->CloseScreen = rfbCloseScreen;
     pScreen->CreateGC = rfbCreateGC;
-    pScreen->PaintWindowBackground = rfbPaintWindowBackground;
-    pScreen->PaintWindowBorder = rfbPaintWindowBorder;
     pScreen->CopyWindow = rfbCopyWindow;
     pScreen->ClearToBackground = rfbClearToBackground;
     pScreen->RestoreAreas = rfbRestoreAreas;
Index: xorg-server-1.8.99.906/hw/xfree86/vnc/vncint.h
===================================================================
--- xorg-server-1.8.99.906.orig/hw/xfree86/vnc/vncint.h
+++ xorg-server-1.8.99.906/hw/xfree86/vnc/vncint.h
@@ -112,8 +112,6 @@ typedef struct {
 
     CloseScreenProcPtr			CloseScreen;
     CreateGCProcPtr			CreateGC;
-    PaintWindowBackgroundProcPtr	PaintWindowBackground;
-    PaintWindowBorderProcPtr		PaintWindowBorder;
     CopyWindowProcPtr			CopyWindow;
     ClearToBackgroundProcPtr		ClearToBackground;
     RestoreAreasProcPtr			RestoreAreas;
