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

Jamey Sharp jamey at minilop.net
Sat Jul 17 10:31:03 PDT 2010


Reviewed-by: Jamey Sharp <jamey at minilop.net>

By the way, there's something of a convention for bug references in
commit messages:

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=29049

At least, I think that's the current rough consensus.

Jamey

On Fri, Jul 16, 2010 at 10:42 AM, Pat Kane <pekane52 at gmail.com> wrote:
> 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
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>


More information about the xorg-devel mailing list