[PATCH xf86-input-mouse 1/2] Support ABI_XINPUT_VERSION 23 (use input_lock/input_unlock)

Peter Hutterer peter.hutterer at who-t.net
Wed Jun 1 00:26:03 UTC 2016


On Mon, May 30, 2016 at 10:45:12PM -0700, Keith Packard wrote:
> This makes using input_lock/input_unlock conditional on the ABI
> version so that we don't get compiler warnings when compiling with the
> newer server bits.
> 
> Signed-off-by: Keith Packard <keithp at keithp.com>

   c22d307..80952e5  master -> master

thanks.

Cheers,
   Peter

> ---
>  src/mouse.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/src/mouse.c b/src/mouse.c
> index f9f874b..d5f918e 100644
> --- a/src/mouse.c
> +++ b/src/mouse.c
> @@ -129,6 +129,10 @@ typedef struct _DragLockRec {
>  } DragLockRec, *DragLockPtr;
>  
>  
> +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 23
> +#define HAVE_THREADED_INPUT	1
> +#endif
> +
>  #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
>  static InputInfoPtr MousePreInit(InputDriverPtr drv, IDevPtr dev, int flags);
>  #else
> @@ -2025,12 +2029,18 @@ static CARD32
>  buttonTimer(InputInfoPtr pInfo)
>  {
>      MouseDevPtr pMse;
> +#if !HAVE_THREADED_INPUT
>      int sigstate;
> +#endif
>      int id;
>  
>      pMse = pInfo->private;
>  
> +#if HAVE_THREADED_INPUT
> +    input_lock();
> +#else
>      sigstate = xf86BlockSIGIO ();
> +#endif
>  
>      pMse->emulate3Pending = FALSE;
>      if ((id = stateTab[pMse->emulateState][4][0]) != 0) {
> @@ -2041,7 +2051,11 @@ buttonTimer(InputInfoPtr pInfo)
>              "Got unexpected buttonTimer in state %d\n", pMse->emulateState);
>      }
>  
> +#if HAVE_THREADED_INPUT
> +    input_unlock();
> +#else
>      xf86UnblockSIGIO (sigstate);
> +#endif
>      return 0;
>  }
>  
> @@ -3276,14 +3290,20 @@ createProtoList(MouseDevPtr pMse, MouseProtocolID *protoList)
>      unsigned char *para;
>      mousePrivPtr mPriv = (mousePrivPtr)pMse->mousePriv;
>      MouseProtocolID *tmplist = NULL;
> +#if !HAVE_THREADED_INPUT
>      int blocked;
> +#endif
>  
>      AP_DBGC(("Autoprobe: "));
>      for (i = 0; i < mPriv->count; i++)
>          AP_DBGC(("%2.2x ", (unsigned char) mPriv->data[i]));
>      AP_DBGC(("\n"));
>  
> +#if HAVE_THREADED_INPUT
> +    input_lock();
> +#else
>      blocked = xf86BlockSIGIO ();
> +#endif
>  
>      /* create a private copy first so we can write in the old list */
>      if ((tmplist = malloc(sizeof(MouseProtocolID) * NUM_AUTOPROBE_PROTOS))){
> @@ -3392,7 +3412,11 @@ createProtoList(MouseDevPtr pMse, MouseProtocolID *protoList)
>          }
>      }
>  
> +#if HAVE_THREADED_INPUT
> +    input_unlock();
> +#else
>      xf86UnblockSIGIO(blocked);
> +#endif
>  
>      mPriv->protoList[k] = PROT_UNKNOWN;
>  
> -- 
> 2.8.1
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel
> 


More information about the xorg-devel mailing list