Smooth scrolling again

Max Schwarz Max at x-quadraht.de
Sun Nov 7 09:03:20 PST 2010


Hi Simon,

> A thing I'm
> missing is how you're establishing the relationship of smooth and button
> scrolling? It might just be me since I'm only looking at the diffs.
It's certainly subtle ;-)
Look at EvdevProcessRelativeMotionEvent().
In case of a change on REL_(H)WHEEL the clicks are queued and "value" is 
multiplied by the current resolution, which is 42 if mouse wheel emulation is 
enabled, and 1 otherwise. The mouse wheel emulation code just injects the raw 
values from the axes.
The toolkit-space code interprets the valuator resolution as ticks per old-
style scroll button click, e.g.
float clicks = event_value / resolution;

> A minor objection is that the evdev wheel resolution is not
> axis-dependent. This may (or may not) be a problem.
Well, it was not handled differently up to this point (same count of clicks 
emitted for both directions).

> Also minor: axes seem to gain a mode (rel/abs), maybe we can make that
> (rel/abs/non-integrating rel)?
You want that distinction in the server? That would require more changes, 
since non-integrating valuators would need to be handled the same as relative 
valuators in most contexts.

Something that I just thought of: Runtime-changing of the resolution is not 
really supported right now. You can change the property, but the resolution 
field of the valuator is not updated, and no XIDeviceChanged events are sent to 
clients...
That would definitely be needed for fine-tuning the wheel resolution (= scroll 
speed).

> Personally I think that noise isn't a synaptics-only problem, so if you
> can come up with sensible helper functions which can be shared among
> drivers this would fit nicely. Something like:
> 
> int rel_hysteresis(int old, int window_size, int current) {
>  if (current > old + window_size)
>     return current - old + window_size;
>  if (current < old - window_size)
>     return current - old - window_size;
>  return 0;
> }
> 
> may be of use for more than one driver - likely it already exists
> somewhere. But OTOH the Server isn't a library for drivers, so it may be
> better to keep in synaptics. In any case, make sure people can tune
> these settings.
Okay, I will implement it in synaptics, we'll see if it is needed by other 
drivers.

Max


More information about the xorg-devel mailing list