On 3/13/19 5:27 PM, joshua stein wrote:
> On Wed, 13 Mar 2019 at 00:41:12 +0100, Ulf Brosziewski wrote:
>> The standard method of scrolling in X is tailored to mouse wheels and
>> proceeds in coarse steps.  Wheel events are mapped to button events, and on
>> receiving such an event, an application moves the view of its data by some
>> fixed distance - usually the height of a line of text, or of a couple of
>> lines.
>>
>> Version 2.1 of the X Input Protocol has introduced a more precise
>> alternative.  It defines additional types of motion events.  In essence,
>> their values represent fractions of a complete scroll unit, and newer
>> applications may move their views by distances that are proportional to the
>> event values.  For applications that don't support this, X generates the
>> standard button events whenever the values add up to the complete unit.
>>
>> synaptics(4) supports the newer method since long.
>>
>> The diffs below add the feature to ws and wstpad.  The kernel part defines
>> two new event types in wsconsio.h, and it adapts the scrolling functions of
>> the touchpad input driver.  The xenocara part adds the new "axes" and event
>> handlers to ws.
>>
>> There is a little twist to the implementation.  While synaptics(4)
>> initializes the scroll axes with the scroll distance in device units, the
>> constant 4096 is used in the new ws code, and event values represent the
>> fraction (motion_delta / scroll_unit) in [*.12] fixed-point format.  That
>> way, no queries for the device- and configuration-dependent scroll unit
>> are necessary.
>>
>> The X Input Protocol calls the method "smooth scrolling", but it seems
>> that nowadays, this term is used exclusively for the rendering technique
>> that displays a little animation when the document position changes, so
>> "precision scrolling" might be a better choice.
>>
>> Tests, comments, and OKs would be welcome.
> 
> Well done!  It works on my touchpad and retains the old "chunky" 
> style scrolling from the mouse wheel on my external mouse.
> 
> My only quibble is that this new style scrolling seems much too fast 
> by default with the default X and wscons mouse acceleration 
> settings.
> 
> 
Much too fast?  I'm a bit surprised.  In my tests, the new method was
generally somewhat slower than the old one (and I haven't changed the
"scroll units").  How did you test it?  Which hardware and which applications
did you use?

Reply via email to