[PATCH] dix: make sure the mask is set for emulated scroll events

Chase Douglas chase.douglas at canonical.com
Mon Aug 6 14:30:10 PDT 2012


On 07/31/2012 08:22 PM, Peter Hutterer wrote:
> If a device has smooth scrolling axes, but submits scroll button events, we
> convert those to motion events and update the valuators. For legacy button
> events, the valuator mask is likely unset though, causing
> add_to_scroll_valuator() to return early, leaving us with an empty mask.
> That again skipped the rest of the code and no events were generated.
>
> Fix it by making sure that the scroll valuator in the mask is at least
> initialized to 0.
>
> Broke evdev wheel emulation, introduced by
> 54476b5e4461ff523e935961affabcf0de12c556.
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
>   dix/getevents.c |    2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/dix/getevents.c b/dix/getevents.c
> index 27c2e04..b3bb162 100644
> --- a/dix/getevents.c
> +++ b/dix/getevents.c
> @@ -1625,6 +1625,8 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
>
>           if (adj != 0.0 && axis != -1) {
>               adj *= pDev->valuator->axes[axis].scroll.increment;
> +            if (!valuator_mask_isset(&mask, axis))
> +                valuator_mask_set(&mask, axis, 0);
>               add_to_scroll_valuator(pDev, &mask, axis, adj);
>               type = MotionNotify;
>               buttons = 0;

Sounds correct to me.

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


More information about the xorg-devel mailing list