--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xvnc/port-to-1.9.patch Mon Mar 14 15:37:30 2011 -0700
@@ -0,0 +1,97 @@
+--- unix/xserver/hw/vnc/xorg-version.h 2010-07-23 18:43:17.578041302 -0700
++++ unix/xserver/hw/vnc/xorg-version.h 2010-07-23 18:44:00.854078060 -0700
+@@ -32,8 +32,10 @@
+ #define XORG 17
+ #elif XORG_VERSION_CURRENT < ((1 * 10000000) + (8 * 100000) + (99 * 1000))
+ #define XORG 18
++#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (9 * 100000) + (99 * 1000))
++#define XORG 19
+ #else
+-#error "X.Org newer than 1.8 is not supported"
++#error "X.Org newer than 1.9 is not supported"
+ #endif
+
+ #endif
+
+--- unix/xserver/hw/vnc/xvnc.cc
++++ unix/xserver/hw/vnc/xvnc.cc
+@@ -609,7 +609,11 @@ vfbInstallColormap(ColormapPtr pmap)
+
+ for (i = 0; i < entries; i++) ppix[i] = i;
+ /* XXX truecolor */
++#if XORG >= 19
++ QueryColors(pmap, entries, ppix, prgb, serverClient);
++#else
+ QueryColors(pmap, entries, ppix, prgb);
++#endif
+
+ for (i = 0; i < entries; i++) { /* convert xrgbs to xColorItems */
+ defs[i].pixel = ppix[i] & 0xff; /* change pixel to index */
+@@ -857,7 +861,11 @@ static Bool vncRandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
+ static void
+ xf86SetRootClip (ScreenPtr pScreen, Bool enable)
+ {
++#if XORG >= 19
++ WindowPtr pWin = pScreen->root;
++#else
+ WindowPtr pWin = WindowTable[pScreen->myNum];
++#endif
+ WindowPtr pChild;
+ Bool WasViewable = (Bool)(pWin->viewable);
+ Bool anyMarked = FALSE;
+
+--- unix/xserver/hw/vnc/vncHooks.cc 2010-09-07 16:44:21.556888424 -0700
++++ unix/xserver/hw/vnc/vncHooks.cc 2010-09-07 17:25:22.176675661 -0700
+@@ -90,7 +90,12 @@
+ GCOps *wrappedOps;
+ } vncHooksGCRec, *vncHooksGCPtr;
+
+-#if XORG == 15
++#if XORG >= 19
++static DevPrivateKeyRec vncHooksScreenPrivateKeyRec;
++#define vncHooksScreenPrivateKey (&vncHooksScreenPrivateKeyRec)
++static DevPrivateKeyRec vncHooksGCPrivateKey;
++#define vncHooksGCPrivateKey (&vncHooksScreenPrivateKeyRec)
++#elif XORG == 15
+ static DevPrivateKey vncHooksScreenPrivateKey = &vncHooksScreenPrivateKey;
+ static DevPrivateKey vncHooksGCPrivateKey = &vncHooksGCPrivateKey;
+ #else
+@@ -223,11 +228,21 @@
+ {
+ vncHooksScreenPtr vncHooksScreen;
+
++#if XORG >= 19
++ if (!dixRegisterPrivateKey(vncHooksScreenPrivateKey, PRIVATE_SCREEN,
++ sizeof(vncHooksScreenRec))) {
++#else
+ if (!dixRequestPrivate(vncHooksScreenPrivateKey, sizeof(vncHooksScreenRec))) {
++#endif
+ ErrorF("vncHooksInit: Allocation of vncHooksScreen failed\n");
+ return FALSE;
+ }
++#if XORG >= 19
++ if (!dixRegisterPrivateKey(vncHooksGCPrivateKey, PRIVATE_GC,
++ sizeof(vncHooksGCRec))) {
++#else
+ if (!dixRequestPrivate(vncHooksGCPrivateKey, sizeof(vncHooksGCRec))) {
++#endif
+ ErrorF("vncHooksInit: Allocation of vncHooksGCRec failed\n");
+ return FALSE;
+ }
+
+--- unix/xserver/hw/vnc/XserverDesktop.cc 2010-09-07 16:44:21.567631294 -0700
++++ unix/xserver/hw/vnc/XserverDesktop.cc 2010-09-07 18:59:36.858315339 -0700
+@@ -770,7 +770,12 @@
+ region.get_rects(&rects);
+ for (i = rects.begin(); i != rects.end(); i++) {
+ for (int y = i->tl.y; y < i->br.y; y++) {
+- (*pScreen->GetImage) ((DrawablePtr)WindowTable[pScreen->myNum],
++#if XORG >= 19
++ WindowPtr screenRoot = pScreen->root;
++#else
++ WindowPtr screenRoot = WindowTable[pScreen->myNum];
++#endif
++ (*pScreen->GetImage) ((DrawablePtr)screenRoot,
+ i->tl.x, y, i->width(), 1,
+ ZPixmap, (unsigned long)~0L,
+ ((char*)data