Subject: Re: bug#51891: 29.0.50; [PATCH] Pixel delta support for wheel events on X

From: Po Lu <[email-masked]>
Date: Thu, 18 Nov 2021 17:17:25 +0800

Eli Zaretskii <[email-masked]> writes:

> A Lisp object could have different types, one each for every use case
> we want to support.  For example, we could use a single object there,
> which in your case will be a list of 2 values, and in other cases will
> have more members.  We do this kind of stuff all the time, including
> in specifying POSITION in various events -- there are a gazillion of
> different forms of POSITION already in Emacs.  I see no reason to
> change the format when all we need to do is add one more form of
> POSITION.

That makes sense, I'll modify the change in a bit to report scroll
deltas as a pair of (DELTA-X . DELTA-Y) instead.

> Sorry, I don't understand: XInput2 knows about FRAME_PIXEL_HEIGHT of
> our frames?

Indeed it does.  It's the window server, after all.

>> An amount of scrolling that would previously generate a `mouse-4' or
>> `mouse-5' event.

> That doesn't really answer my question.  Let me ask it differently:
> how does "scroll unit" differ from "every time the wheel is moved"?

Basically, even tiny movements of the scroll wheel will cause XInput 2
to generate wheel events.  This makes the behavior stay like the
original by default, where you have to scroll 96 or so pixels before a
wheel event is actually sent.  (This is generally true, but certain mice
may behave differently.)

> I might have ideas once I understand what you are trying to say ;-)

Thanks, I hope what I just said clears things up a bit.