Smooth scrolling - results!

Simon Thum simon.thum at gmx.de
Sun Jun 13 03:17:00 PDT 2010


Am 12.06.2010 18:03, schrieb Max Schwarz:
> Hi Simon,
> 
>> You'll have to rebase them against git master to get into mainline. Why
>> didn't you use git master to start with?
> That's because I like to work with the versions I have installed. Otherwise I 
> would need to compile the whole Xorg stack, this way I can just change one 
> component at a time...
> Well, that was my decision, I will do the rebase some time this week.
I just wanted to be sure it was intentional, not miscommunication.

>> From your description, the following might work: You feed all wheel data
>> into an accel context (i.e. call ProcessVelocityData2D), as well as
>> keeping a sum yourself.
>>
>> If PVD2D returns true, reset your sum to 0 and don't emit anything.
>> If PVD2D returns false AND abs(sum) > your_threshold (say 1 or 2), you
>> start emitting scrolling events until PVD2D gives you true again.
>>
>> True means a lot of time has passed since the last call, by default 200 ms.
Arrgh, that description is bogus. When deciding the theshold, sum must
of course include the current motion or you'll induce delay. So it's like:
reset = PVD2D(wheelx, wheely) // maybe conditional on wheel != 0
if (reset) {
  sumx = wheelx; sumy = ...
} else {
  sumx += wheelx; ...
}
// allow to stop emitting. Evaluating reset protects us
// from stopping emission due to zero sums in up-down motion
if(reset && emit_x) emit_x = sumx > theshold
(same for y)
// allow to start emitting
if(!emit_x) emit_x = sumx > theshold
(same for y)

> Thanks for the pointers. Do you think it would be better to implement this in 
> the input drivers or in the server itself?
Personally I'd like to see it in the dix, but I'd say there should at
first be algorithms which definitively are sensible across devices.

As a preparation, you might be better off ABI/API-wise to add a flags
field to the axis struct and corresponding functions instead of a boolean.

> I'll experiment with cutting the events below a certain threshold to 
> reduce/block the noise.
FWIW, you'll find similar techniques under hysteresis or moving window.
A moving window, I guess, is what qualifies for dix by the criteria
mentioned above.

Cheers,

Simon



More information about the xorg-devel mailing list