[PATCH] xf86-input-mouse: Update sun_mouse devPrivates code #29049

Pat Kane pekane52 at gmail.com
Fri Jul 16 10:42:42 PDT 2010


Update the sun_mouse devPrivates code to conform to the new API
(introducted by commit faeebead7bfcc78535757ca7acc1faf7554c03b7)
that requires the PrivateKey to be registered.

See BUG 29049.

Signed-off-by: Patrick E. Kane <pekane52 at gmail.com>
---
 src/sun_mouse.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/sun_mouse.c b/src/sun_mouse.c
index f6e8dbb..8d5a80d 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];
-- 
1.7.0.4


More information about the xorg-devel mailing list