On Thu, Sep 22, 2011 at 11:05:42AM +0100, Daniel Stone wrote:
> Hi,
> 
> On Mon, Aug 22, 2011 at 03:35:15PM +1000, Peter Hutterer wrote:
> > +#ifdef HAVE_SMOOTH_SCROLLING
> > +        if (axis == REL_WHEEL)
> > +            SetScrollValuator(device, axnum, SCROLL_TYPE_VERTICAL, 1.0, 
> > SCROLL_FLAG_PREFERRED);
> > +        else if (axis == REL_DIAL)
> > +            SetScrollValuator(device, axnum, SCROLL_TYPE_VERTICAL, 1.0, 
> > SCROLL_FLAG_NONE);
> 
> This will break scroll emulation on devices which have a dial but not a
> vertical wheel.

how so? the Preferred is only preferred if there are two axes, otherwise the
first axis is chosen. So for a device without REL_WHEEL, you only get one
vert scroll valuator - REL_DIAL and that's the one chosen for emulation.

> 
> > +        else if (axis == REL_HWHEEL)
> > +            SetScrollValuator(device, axnum, SCROLL_TYPE_HORIZONTAL, 1.0, 
> > SCROLL_FLAG_NONE);
> > +#endif
> 
> And this should be _PREFERRED, no? (See inputproto review.)

I think the wording in the proto isn't clear enough. The scroll emulation
approach is essentially:

if (count(vert scroll axes) == 1):
   use that axis
else if (count > 1):
   if (one is preferred):
       use preferred axis
   else:
        don't do that!

so we only need preferred if we have more than one axis on that scroll
direction.  We could set the horiz axis to Prefered but it really doesn't
make a difference here.

Cheers,
  Peter
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to