summaryrefslogtreecommitdiff
path: root/uxa
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-04-30 13:33:54 -0700
committerOwain G. Ainsworth <oga@openbsd.org>2010-06-07 21:07:57 +0100
commit34ce21b8537a1873b70437b273f3d6b46ed5b443 (patch)
tree71c565c4e48398df927da1e1aa290abafcd5144d /uxa
parentae9f6675da8663d3b2706c7975c6160fea23f676 (diff)
Adapt to DevPrivate API changes
This allows the driver to be built against either the old or new DevPrivate API. Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 42ddc39430a10513c49a415ddf1a0dc5fa52089e) Signed-off-by: Owain G. Ainsworth <oga@openbsd.org>
Diffstat (limited to 'uxa')
-rw-r--r--uxa/uxa-priv.h5
-rw-r--r--uxa/uxa.c8
2 files changed, 13 insertions, 0 deletions
diff --git a/uxa/uxa-priv.h b/uxa/uxa-priv.h
index 36625de8..01a292e2 100644
--- a/uxa/uxa-priv.h
+++ b/uxa/uxa-priv.h
@@ -165,7 +165,12 @@ typedef struct {
(PixmapWidthPaddingInfo[d].padRoundUp+1)))
#endif
+#if HAS_DEVPRIVATEKEYREC
+extern DevPrivateKeyRec uxa_screen_index;
+#else
extern int uxa_screen_index;
+#endif
+
static inline uxa_screen_t *uxa_get_screen(ScreenPtr screen)
{
return (uxa_screen_t *) dixLookupPrivate(&screen->devPrivates,
diff --git a/uxa/uxa.c b/uxa/uxa.c
index e6f96705..19c6a2d1 100644
--- a/uxa/uxa.c
+++ b/uxa/uxa.c
@@ -39,7 +39,11 @@
#include "dixfontstr.h"
#include "uxa.h"
+#if HAS_DEVPRIVATEKEYREC
+DevPrivateKeyRec uxa_screen_index;
+#else
int uxa_screen_index;
+#endif
/**
* uxa_get_drawable_pixmap() returns a backing pixmap for a given drawable.
@@ -460,6 +464,10 @@ Bool uxa_driver_init(ScreenPtr screen, uxa_driver_t * uxa_driver)
"non-NULL\n", screen->myNum);
return FALSE;
}
+#if HAS_DIXREGISTERPRIVATEKEY
+ if (!dixRegisterPrivateKey(&uxa_screen_index, PRIVATE_SCREEN, 0))
+ return FALSE;
+#endif
uxa_screen = calloc(sizeof(uxa_screen_t), 1);
if (!uxa_screen) {