open-src/xserver/xvnc/port-to-1.9.patch
author Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
Mon, 14 Mar 2011 15:37:30 -0700
changeset 1088 1c99106ccbe0
child 1103 cd782ec1154c
permissions -rw-r--r--
6983602 Xorg 1.9 integration [PSARC/2011/008]
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1088
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     1
--- unix/xserver/hw/vnc/xorg-version.h	2010-07-23 18:43:17.578041302 -0700
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     2
+++ unix/xserver/hw/vnc/xorg-version.h	2010-07-23 18:44:00.854078060 -0700
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     3
@@ -32,8 +32,10 @@
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     4
 #define XORG 17
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     5
 #elif XORG_VERSION_CURRENT < ((1 * 10000000) + (8 * 100000) + (99 * 1000))
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     6
 #define XORG 18
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     7
+#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (9 * 100000) + (99 * 1000))
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     8
+#define XORG 19
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     9
 #else
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    10
-#error "X.Org newer than 1.8 is not supported"
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    11
+#error "X.Org newer than 1.9 is not supported"
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    12
 #endif
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    13
 
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    14
 #endif
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    15
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    16
--- unix/xserver/hw/vnc/xvnc.cc
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    17
+++ unix/xserver/hw/vnc/xvnc.cc
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    18
@@ -609,7 +609,11 @@ vfbInstallColormap(ColormapPtr pmap)
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    19
 
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    20
 	for (i = 0; i < entries; i++)  ppix[i] = i;
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    21
 	/* XXX truecolor */
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    22
+#if XORG >= 19
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    23
+	QueryColors(pmap, entries, ppix, prgb, serverClient);
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    24
+#else
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    25
 	QueryColors(pmap, entries, ppix, prgb);
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    26
+#endif
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    27
 
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    28
 	for (i = 0; i < entries; i++) { /* convert xrgbs to xColorItems */
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    29
 	    defs[i].pixel = ppix[i] & 0xff; /* change pixel to index */
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    30
@@ -857,7 +861,11 @@ static Bool vncRandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    31
 static void
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    32
 xf86SetRootClip (ScreenPtr pScreen, Bool enable)
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    33
 {
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    34
+#if XORG >= 19
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    35
+    WindowPtr	pWin = pScreen->root;
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    36
+#else
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    37
     WindowPtr	pWin = WindowTable[pScreen->myNum];
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    38
+#endif
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    39
     WindowPtr	pChild;
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    40
     Bool	WasViewable = (Bool)(pWin->viewable);
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    41
     Bool	anyMarked = FALSE;
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    42
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    43
--- unix/xserver/hw/vnc/vncHooks.cc	2010-09-07 16:44:21.556888424 -0700
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    44
+++ unix/xserver/hw/vnc/vncHooks.cc	2010-09-07 17:25:22.176675661 -0700
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    45
@@ -90,7 +90,12 @@
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    46
     GCOps *wrappedOps;
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    47
 } vncHooksGCRec, *vncHooksGCPtr;
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    48
 
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    49
-#if XORG == 15
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    50
+#if XORG >= 19
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    51
+static DevPrivateKeyRec vncHooksScreenPrivateKeyRec;
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    52
+#define vncHooksScreenPrivateKey (&vncHooksScreenPrivateKeyRec)
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    53
+static DevPrivateKeyRec vncHooksGCPrivateKey;
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    54
+#define vncHooksGCPrivateKey (&vncHooksScreenPrivateKeyRec)
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    55
+#elif XORG == 15
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    56
 static DevPrivateKey vncHooksScreenPrivateKey = &vncHooksScreenPrivateKey;
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    57
 static DevPrivateKey vncHooksGCPrivateKey = &vncHooksGCPrivateKey;
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    58
 #else
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    59
@@ -223,11 +228,21 @@
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    60
 {
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    61
   vncHooksScreenPtr vncHooksScreen;
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    62
 
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    63
+#if XORG >= 19
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    64
+  if (!dixRegisterPrivateKey(vncHooksScreenPrivateKey, PRIVATE_SCREEN,
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    65
+			     sizeof(vncHooksScreenRec))) {
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    66
+#else
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    67
   if (!dixRequestPrivate(vncHooksScreenPrivateKey, sizeof(vncHooksScreenRec))) {
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    68
+#endif
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    69
     ErrorF("vncHooksInit: Allocation of vncHooksScreen failed\n");
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    70
     return FALSE;
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    71
   }
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    72
+#if XORG >= 19
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    73
+  if (!dixRegisterPrivateKey(vncHooksGCPrivateKey, PRIVATE_GC,
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    74
+			     sizeof(vncHooksGCRec))) {
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    75
+#else
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    76
   if (!dixRequestPrivate(vncHooksGCPrivateKey, sizeof(vncHooksGCRec))) {
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    77
+#endif
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    78
     ErrorF("vncHooksInit: Allocation of vncHooksGCRec failed\n");
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    79
     return FALSE;
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    80
   }
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    81
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    82
--- unix/xserver/hw/vnc/XserverDesktop.cc	2010-09-07 16:44:21.567631294 -0700
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    83
+++ unix/xserver/hw/vnc/XserverDesktop.cc	2010-09-07 18:59:36.858315339 -0700
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    84
@@ -770,7 +770,12 @@
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    85
   region.get_rects(&rects);
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    86
   for (i = rects.begin(); i != rects.end(); i++) {
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    87
     for (int y = i->tl.y; y < i->br.y; y++) {
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    88
-      (*pScreen->GetImage) ((DrawablePtr)WindowTable[pScreen->myNum],
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    89
+#if XORG >= 19
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    90
+      WindowPtr screenRoot = pScreen->root;
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    91
+#else
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    92
+      WindowPtr screenRoot = WindowTable[pScreen->myNum];
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    93
+#endif
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    94
+      (*pScreen->GetImage) ((DrawablePtr)screenRoot,
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    95
                             i->tl.x, y, i->width(), 1,
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    96
                             ZPixmap, (unsigned long)~0L,
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    97
                             ((char*)data