[PATCH] Allow ConstantDeceleration and AdaptiveDeceleration < 1.0

Peter Hutterer peter.hutterer at who-t.net
Thu Jun 9 23:44:05 UTC 2016


On Wed, Jun 08, 2016 at 10:26:53PM -0500, Eric Biggers wrote:
> As documented in xorg.conf(5), a value of ConstantDeceleration between 0
> and 1 will speed up the pointer.  However, values less than 1 actually
> had no effect.  Fix this.

yeah, ok, I can live with that.

> For consistency I also made the same change for AdaptiveDeceleration,
> which had the same behavior.

but not this one, imo this one doesn't make sense. adaptive deceleration
means it makes the pointer slower when going slow, allowing for something <
1.0 here means you accelerate the pointer more the slower you go? I doubt
this is a reasonable use-case.

> Note that this bug only affected "ConstantDeceleration" as configured
> through xorg.conf, not "Device Accel Constant Deceleration" as configured
> through xinput.

The matching property bit is in AccelSetAdaptDecelProperty() in
dix/ptrveloc.c, please fix this as well (and test it!).

Cheers,
   Peter

> Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=92766
> Signed-off-by: Eric Biggers <ebiggers3 at gmail.com>
> ---
>  hw/xfree86/common/xf86Xinput.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
> index d18f53e..6e859c6 100644
> --- a/hw/xfree86/common/xf86Xinput.c
> +++ b/hw/xfree86/common/xf86Xinput.c
> @@ -130,7 +130,7 @@ ProcessVelocityConfiguration(DeviceIntPtr pDev, const char *devname, void *list,
>  
>      /* common settings (available via device properties) */
>      tempf = xf86SetRealOption(list, "ConstantDeceleration", 1.0);
> -    if (tempf > 1.0) {
> +    if (tempf != 1.0) {
>          xf86Msg(X_CONFIG, "%s: (accel) constant deceleration by %.1f\n",
>                  devname, tempf);
>          prop = XIGetKnownProperty(ACCEL_PROP_CONSTANT_DECELERATION);
> @@ -139,7 +139,7 @@ ProcessVelocityConfiguration(DeviceIntPtr pDev, const char *devname, void *list,
>      }
>  
>      tempf = xf86SetRealOption(list, "AdaptiveDeceleration", 1.0);
> -    if (tempf > 1.0) {
> +    if (tempf != 1.0) {
>          xf86Msg(X_CONFIG, "%s: (accel) adaptive deceleration by %.1f\n",
>                  devname, tempf);
>          prop = XIGetKnownProperty(ACCEL_PROP_ADAPTIVE_DECELERATION);
> -- 
> 2.8.3
> 
> _______________________________________________
> 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