aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-09-24 10:10:29 +0000
committermarha <marha@users.sourceforge.net>2010-09-24 10:10:29 +0000
commit84b35d18d0b84909f7216fc6a7487ffa72bd3f18 (patch)
treea6a1cf67169f65d2b680c6d3f548d45901284aff /xorg-server/dix
parent6a14682c40a85bbfdb5023a3330e95a3a3c0ad03 (diff)
downloadvcxsrv-84b35d18d0b84909f7216fc6a7487ffa72bd3f18.tar.gz
vcxsrv-84b35d18d0b84909f7216fc6a7487ffa72bd3f18.tar.bz2
vcxsrv-84b35d18d0b84909f7216fc6a7487ffa72bd3f18.zip
xserver xkbcomp libxcb pixman git update 24/9/2010
Diffstat (limited to 'xorg-server/dix')
-rw-r--r--xorg-server/dix/privates.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/xorg-server/dix/privates.c b/xorg-server/dix/privates.c
index a7366447a..1500dabb1 100644
--- a/xorg-server/dix/privates.c
+++ b/xorg-server/dix/privates.c
@@ -237,28 +237,35 @@ dixRegisterPrivateKey(DevPrivateKey key, DevPrivateType type, unsigned size)
return TRUE;
}
-/*
- * Allocate a new private key.
- *
- * This manages the storage of the key object itself, freeing it when the
- * privates system is restarted at server reset time. All other keys
- * are expected to be statically allocated as the privates must be
- * reset after all objects have been freed
- */
-DevPrivateKey
-dixCreatePrivateKey(DevPrivateType type, unsigned size)
+Bool
+dixRegisterScreenPrivateKey(DevScreenPrivateKey screenKey, ScreenPtr pScreen, DevPrivateType type, unsigned size)
{
DevPrivateKey key;
+ if (!dixRegisterPrivateKey(&screenKey->screenKey, PRIVATE_SCREEN, 0))
+ return FALSE;
+ key = dixGetPrivate(&pScreen->devPrivates, &screenKey->screenKey);
+ if (key != NULL) {
+ assert(key->size == size);
+ assert(key->type == type);
+ return TRUE;
+ }
key = calloc(sizeof (DevPrivateKeyRec), 1);
if (!key)
- return NULL;
+ return FALSE;
if (!dixRegisterPrivateKey(key, type, size)) {
free(key);
- return NULL;
+ return FALSE;
}
key->allocated = TRUE;
- return key;
+ dixSetPrivate(&pScreen->devPrivates, &screenKey->screenKey, key);
+ return TRUE;
+}
+
+DevPrivateKey
+_dixGetScreenPrivateKey(const DevScreenPrivateKey key, ScreenPtr pScreen)
+{
+ return dixGetPrivate(&pScreen->devPrivates, &key->screenKey);
}
/*