Subject: bug#61307: 30.0.50; pixel-scroll-precision-mode: window-scroll-functions?

From: Po Lu <[email-masked]>
Date: Sun, 19 Feb 2023 14:54:46 +0800

Michael Heerdegen <[email-masked]> writes:

> Eli Zaretskii <[email-masked]> writes:
>
>> I'm not sure, but Po Lu will know.
>>
>> In any case, AFAIR some mice produce mouse-4 and mouse-5 events
>> instead, so relying on the events' symbols might not be the best
>> idea.  We are supposed to know whether the device supports pixel
>> precision, so maybe basing the decision on that is better?
>
> So, would this already be good enough as a start?
>
> diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el
> index 487144144f5..1d2d3ff10fe 100644
> --- a/lisp/pixel-scroll.el
> +++ b/lisp/pixel-scroll.el
> @@ -714,7 +714,10 @@ pixel-scroll-precision
>                        (let ((kin-state (pixel-scroll-kinetic-state)))
>                          (aset kin-state 0 (make-ring 30))
>                          (aset kin-state 1 nil))
> -                      (pixel-scroll-precision-interpolate delta current-window))
> +                      (pixel-scroll-precision-interpolate delta current-window)
> +                      (run-hook-with-args 'window-scroll-functions
> +                                          current-window
> +                                          (window-start current-window)))
>                    (condition-case nil
>                        (progn
>                          (if (< delta 0)
>
>
> AFAIU, in that branch of the code we know that we are presumably dealing
> with a mouse or we scrolled by a larger amount.
>
> Michael.

What if you are scrolling with a touch pad or core pointer that never
triggers the ``large scroll'' options?

Either way, please make sure it stays fast (or at least put it behind an
option which is off by default.)

If window-scroll-functions are not called, then it stays tolerable for
many people.  But users will become extremely annoyed if precision pixel
scrolling becomes too slow.