summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick E. Kane <pekane52@gmail.com>2010-07-16 11:13:20 -0500
committerJamey Sharp <jamey@minilop.net>2010-07-19 12:20:11 -0700
commit75300d6ae5a5b2324224423c9f976cba50e47547 (patch)
tree6794df6b0fc951942953bc5093ae9fc24d81023f
parent112caa1724e139caeb91c792c394b21d1391b370 (diff)
xf86-input-mouse: Update sun_mouse devPrivates code #29049
Update the sun_mouse devPrivates code to conform to the new API (introducted by commit faeebead7bfcc78535757ca7acc1faf7554c03b7) that requires the PrivateKey to be registered. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=29049 Signed-off-by: Patrick E. Kane <pekane52@gmail.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Jamey Sharp <jamey@minilop.net>
-rw-r--r--src/sun_mouse.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sun_mouse.c b/src/sun_mouse.c
index f6e8dbb..ddcdd90 100644
--- a/src/sun_mouse.c
+++ b/src/sun_mouse.c
@@ -116,7 +116,13 @@ static void vuidMouseSendScreenSize(ScreenPtr pScreen, VuidMsePtr pVuidMse);
static void vuidMouseAdjustFrame(int index, int x, int y, int flags);
static int vuidMouseGeneration = 0;
+
+#if HAS_DEVPRIVATEKEYREC
+static DevPrivateKeyRec vuidMouseScreenIndex;
+#else
static int vuidMouseScreenIndex;
+#endif /* HAS_DEVPRIVATEKEYREC */
+
#define vuidMouseGetScreenPrivate(s) ( \
dixLookupPrivate(&(s)->devPrivates, &vuidMouseScreenIndex))
#define vuidMouseSetScreenPrivate(s,p) \
@@ -542,6 +548,12 @@ vuidMouseProc(DeviceIntPtr pPointer, int what)
case DEVICE_INIT:
#ifdef HAVE_ABSOLUTE_MOUSE_SCALING
+
+#if HAS_DEVPRIVATEKEYREC
+ if (!dixRegisterPrivateKey(&vuidMouseScreenIndex, PRIVATE_SCREEN, 0))
+ return BadAlloc;
+#endif /* HAS_DEVPRIVATEKEYREC */
+
if (vuidMouseGeneration != serverGeneration) {
for (i = 0; i < screenInfo.numScreens; i++) {
ScreenPtr pScreen = screenInfo.screens[i];