[PATCH evdev] Devices configured as mice need REL_X/Y

Chase Douglas chase.douglas at canonical.com
Mon Apr 30 10:53:28 PDT 2012


On 04/26/2012 11:05 PM, Peter Hutterer wrote:
> Some keyboards export scroll axes and any absolute axis possible in 11
> dimensions. All these axes are mute, except possibly for the scroll wheels.
> 
> So if a device has a scroll axis, and we're configuring it as mouse, force
> the x/y axes into existence. This stops the logspam complaining about not
> enough axes on pointer movement after a xrandr change.
> 
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
> This may also be the fix for 47281 though it's likely more of a workaround
> than a fix.
> 
>  src/evdev.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/evdev.c b/src/evdev.c
> index ff43dcf..923d9cd 100644
> --- a/src/evdev.c
> +++ b/src/evdev.c
> @@ -2364,6 +2364,9 @@ EvdevProbe(InputInfoPtr pInfo)
>              xf86IDrvMsg(pInfo, X_INFO, "Configuring as touchscreen\n");
>              pInfo->type_name = XI_TOUCHSCREEN;
>  	} else {
> +            if (!EvdevBitIsSet(pEvdev->rel_bitmask, REL_X) ||
> +                !EvdevBitIsSet(pEvdev->rel_bitmask, REL_Y))
> +                EvdevForceXY(pInfo, Relative);
>  	    xf86IDrvMsg(pInfo, X_INFO, "Configuring as mouse\n");
>  	    pInfo->type_name = XI_MOUSE;
>  	}

Looks good to me.

Reviewed-by: Chase Douglas <chase.douglas at canonical.com>


More information about the xorg-devel mailing list