aboutsummaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorAdam Tkac <atkac@redhat.com>2010-07-20 09:31:38 +0000
committerAdam Tkac <atkac@redhat.com>2010-07-20 09:31:38 +0000
commit62094c76fcf7937ce68a8775f69d2521aed21242 (patch)
tree52f77b18394cd9a4ee8465e4d0dcb08212486a11 /unix
parent590aa05d11578999aa8569c94b15b80013984b10 (diff)
downloadtigervnc-62094c76fcf7937ce68a8775f69d2521aed21242.tar.gz
tigervnc-62094c76fcf7937ce68a8775f69d2521aed21242.zip
[Development] Improve privates handling in vncHooks to be compatible with X.Org 1.9.X.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4089 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix')
-rw-r--r--unix/xserver/hw/vnc/vncHooks.cc24
1 files changed, 22 insertions, 2 deletions
diff --git a/unix/xserver/hw/vnc/vncHooks.cc b/unix/xserver/hw/vnc/vncHooks.cc
index 23dc4ea6..c9a9abf9 100644
--- a/unix/xserver/hw/vnc/vncHooks.cc
+++ b/unix/xserver/hw/vnc/vncHooks.cc
@@ -93,11 +93,16 @@ typedef struct {
#if XORG == 15
static DevPrivateKey vncHooksScreenPrivateKey = &vncHooksScreenPrivateKey;
static DevPrivateKey vncHooksGCPrivateKey = &vncHooksGCPrivateKey;
-#else
+#elif XORG < 19
static int vncHooksScreenPrivateKeyIndex;
static int vncHooksGCPrivateKeyIndex;
static DevPrivateKey vncHooksScreenPrivateKey = &vncHooksScreenPrivateKeyIndex;
static DevPrivateKey vncHooksGCPrivateKey = &vncHooksGCPrivateKeyIndex;
+#else
+static DevPrivateKeyRec vncHooksScreenKeyRec;
+static DevPrivateKeyRec vncHooksGCKeyRec;
+#define vncHooksScreenPrivateKey (&vncHooksScreenKeyRec)
+#define vncHooksGCPrivateKey (&vncHooksGCKeyRec)
#endif
#define vncHooksScreenPrivate(pScreen) \
@@ -223,6 +228,7 @@ Bool vncHooksInit(ScreenPtr pScreen, XserverDesktop* desktop)
{
vncHooksScreenPtr vncHooksScreen;
+#if XORG < 19
if (!dixRequestPrivate(vncHooksScreenPrivateKey, sizeof(vncHooksScreenRec))) {
ErrorF("vncHooksInit: Allocation of vncHooksScreen failed\n");
return FALSE;
@@ -232,6 +238,20 @@ Bool vncHooksInit(ScreenPtr pScreen, XserverDesktop* desktop)
return FALSE;
}
+#else
+ if (!dixRegisterPrivateKey(&vncHooksScreenKeyRec, PRIVATE_SCREEN,
+ sizeof(vncHooksScreenRec))) {
+ ErrorF("vncHooksInit: Allocation of vncHooksScreen failed\n");
+ return FALSE;
+ }
+ if (!dixRegisterPrivateKey(&vncHooksGCKeyRec, PRIVATE_GC,
+ sizeof(vncHooksGCRec))) {
+ ErrorF("vncHooksInit: Allocation of vncHooksGCRec failed\n");
+ return FALSE;
+ }
+
+#endif
+
vncHooksScreen = vncHooksScreenPrivate(pScreen);
vncHooksScreen->desktop = desktop;
@@ -344,7 +364,7 @@ static Bool vncHooksCloseScreen(int i, ScreenPtr pScreen_)
static Bool vncHooksCreateGC(GCPtr pGC)
{
SCREEN_UNWRAP(pGC->pScreen, CreateGC);
-
+
vncHooksGCPtr vncHooksGC = vncHooksGCPrivate(pGC);
Bool ret = (*pScreen->CreateGC) (pGC);