On Wed, Apr 30, 2014 at 07:00:37PM -0700, Jason Gerecke wrote:
> The factor[XY] variables were introduced to make relative devices behave
> more naturally by taking into account the differences between screen
> space and device space. In particular, these variables were used to
> provide uniform acceleration along the X and Y axes, along with
> suppressing events that moved the cursor less than one pixel.
> 
> While these functions would still be nice to have, the variables
> themselves are vestigal since they cannot be calculated properly
> anymore. The X server is now (actually, for quite some time) responsible
> for mapping the device to specific areas of the screen, and our driver
> no longer has any notion of screen dimension.

fwiw, if you want to detect this at compile time, the server takes the
resolution of the device into account since ABI_XINPUT_VERSION 19.2. Since
then, a circle on a tablet in rel mode should be a circle on the screen,
regardless of any other influences.

Having said that, feel free to purge this code though, I'll cheer on you all
the way to the repo :)

Cheers,
   Peter

> 
> NOTE: Strictly speaking factor[XY] aren't /entirely/ dead. There is *one*
> case where they are still set to a value other than 1.0 (setting either
> TopX or TopY in xorg.conf). However, this side-effect is not at all
> what is intended/expected so the functionality is still safe to remove.
> 
> Signed-off-by: Jason Gerecke <killert...@gmail.com>
> ---
>  src/wcmCommon.c     | 40 ----------------------------------------
>  src/xf86Wacom.c     |  1 -
>  src/xf86Wacom.h     |  3 ---
>  src/xf86WacomDefs.h |  2 --
>  4 files changed, 46 deletions(-)
> 
> diff --git a/src/wcmCommon.c b/src/wcmCommon.c
> index 87bc76c..7f78d0c 100644
> --- a/src/wcmCommon.c
> +++ b/src/wcmCommon.c
> @@ -86,38 +86,6 @@ void set_absolute(InputInfoPtr pInfo, Bool absolute)
>  }
>  
>  
> /*****************************************************************************
> - * wcmMappingFactor --
> - *   calculate the proper tablet to screen mapping factor according to the 
> - *   screen/desktop size and the tablet size 
> - 
> ****************************************************************************/
> -
> -void wcmMappingFactor(InputInfoPtr pInfo)
> -{
> -     WacomDevicePtr priv = (WacomDevicePtr) pInfo->private;
> -     double size_x, size_y;
> -
> -     DBG(10, priv, "\n"); /* just prints function name */
> -
> -     DBG(10, priv,
> -             "Active tablet area x=%d y=%d map\n",
> -             priv->bottomX, priv->bottomY);
> -
> -     /* bottomX/bottomY are scaled values of maxX/maxY such that it
> -      * will scale tablet to screen ratio when passed to xf86AxisScale().
> -      * Use this to compute similar factor for scaling in relative
> -      * mode.  If screen:tablet are 1:1 ratio then no scaling.
> -      */
> -
> -     size_x = priv->bottomX - priv->topX;
> -     size_y = priv->bottomY - priv->topY;
> -
> -     priv->factorX = size_x / priv->bottomX;
> -     priv->factorY = size_y / priv->bottomY;
> -     DBG(2, priv, "X factor = %.3f, Y factor = %.3f\n",
> -             priv->factorX, priv->factorY);
> -}
> -
> -/*****************************************************************************
>   * wcmSendButtons --
>   *   Send button events by comparing the current button mask with the
>   *   previous one.
> @@ -610,12 +578,6 @@ wcmSendNonPadEvents(InputInfoPtr pInfo, const 
> WacomDeviceState *ds,
>       /* coordinates are ready we can send events */
>       if (ds->proximity)
>       {
> -             /* unify acceleration in both directions
> -              * for relative mode to draw a circle
> -              */
> -             if (!is_absolute(pInfo))
> -                     valuators[0] *= priv->factorY / priv->factorX;
> -
>               /* don't emit proximity events if device does not support 
> proximity */
>               if ((pInfo->dev->proximity && !priv->oldProximity))
>                       xf86PostProximityEventP(pInfo->dev, 1, first_val, 
> num_vals,
> @@ -1310,8 +1272,6 @@ static void commonDispatchDevice(WacomCommonPtr common, 
> unsigned int channel,
>                */
>               double deltx = filtered.x - priv->oldX;
>               double delty = filtered.y - priv->oldY;
> -             deltx *= priv->factorX;
> -             delty *= priv->factorY;
>  
>               /* less than one device coordinate movement? */
>               if (abs(deltx)<1 && abs(delty)<1)
> diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
> index 5290c4e..7b565a0 100644
> --- a/src/xf86Wacom.c
> +++ b/src/xf86Wacom.c
> @@ -425,7 +425,6 @@ static int wcmDevInit(DeviceIntPtr pWcm)
>       if (!IsPad(priv))
>       {
>               wcmInitialToolSize(pInfo);
> -             wcmMappingFactor(pInfo);
>       }
>  
>       if (!wcmInitAxes(pWcm))
> diff --git a/src/xf86Wacom.h b/src/xf86Wacom.h
> index 3f1b028..514a5c2 100644
> --- a/src/xf86Wacom.h
> +++ b/src/xf86Wacom.h
> @@ -124,9 +124,6 @@ void wcmEvent(WacomCommonPtr common, unsigned int 
> channel, const WacomDeviceStat
>  /* dispatches data to XInput event system */
>  void wcmSendEvents(InputInfoPtr pInfo, const WacomDeviceState* ds);
>  
> -/* calculate the proper tablet to screen mapping factor */
> -void wcmMappingFactor(InputInfoPtr pInfo);
> -
>  /* validation */
>  extern Bool wcmIsAValidType(InputInfoPtr pInfo, const char* type);
>  extern Bool wcmIsWacomDevice (char* fname);
> diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
> index 0894880..6ff9fa9 100644
> --- a/src/xf86WacomDefs.h
> +++ b/src/xf86WacomDefs.h
> @@ -240,8 +240,6 @@ struct _WacomDeviceRec
>       int resolY;             /* Y resolution */
>       int maxX;               /* tool physical maxX in device coordinates*/
>       int maxY;               /* tool physical maxY in device coordinates*/
> -     double factorX;         /* X factor */
> -     double factorY;         /* Y factor */
>       unsigned int serial;    /* device serial number this device takes (if 
> 0, any serial is ok) */
>       unsigned int cur_serial; /* current serial in prox */
>       int cur_device_id;      /* current device ID in prox */
> -- 
> 1.9.2

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to