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

From: Michael Heerdegen <[email-masked]>
Date: Sun, 19 Feb 2023 06:50:29 +0100

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.