Hello,

As described in https://pavelfatin.com/scrolling-with-pleasure/#linux and
https://pavelfatin.com/scrolling-with-pleasure/#pixel-precise-scrolling,
ideally, we need an API that distinguishes between "relative" and
"absolute" deltas. Otherwise, the scrolling would be smooth, but its speed
would depend on the line height, so that the speed might vary between
different applications, and scrolling might be non-linear (as explained in
https://pavelfatin.com/scrolling-with-pleasure/#model and
https://pavelfatin.com/scrolling-with-pleasure/#mouse-wheel).

Most modern APIs and toolkits do support pixel deltas, e.g.:
* Qt: https://doc.qt.io/qt-5/qwheelevent.html#pixelDelta
* GTK:
https://github.com/GNOME/gtk/blob/7bee22bcb6ad9a71bfcf8a38edc070a685a627a3/gtk/gtkscrolledwindow.c#L1245
* JavaFX:
https://docs.oracle.com/javase/8/javafx/api/javafx/scene/input/ScrollEvent.html#getDeltaY--
* DOM Level 3 (web browsers):
https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/deltaMode

Even in the presence of a touchscreen-specific API, it still makes sense to
generate the normal scroll events (we can do that not just in Linux, but
also in Windows & macOS).

It seems that enhancing MouseWheelEvent is a good way to support "absolute"
deltas, which would be consistent with other similar APIs.

Sincerely,
Pavel


On Wed, Jan 15, 2020 at 1:00 PM Denis Konoplev <[email protected]>
wrote:

> Hello Sergey,
>
> I can enable smooth scrolling on linux via xinput2.
> As I understand it, correct me if i am wrong, this change don't require
> change of public API, we can use precise delta?
>
> Looking forward to hearing from you,
> Denis
>
> From: Alexey Ushakov <[email protected]>
>> Date: Mon, Jan 13, 2020 at 12:19 PM
>> Subject: Re: <AWT Dev> Update to the proposal on enhancing MouseWheelEvent
>> To: Sergey Bylokhov <[email protected]>
>> Cc: Denis Konoplev <[email protected]>, Pavel Fatin <
>> [email protected]>, <[email protected]>
>>
>>
>> Hello Sergey,
>>
>> We’ve resumed our work on smooth scrolling. However, this time we started
>> from other end - we’ve implemented support of touch screen devices on Linux
>> and Windows. I think we can extend it on precise scrolling deltas for high
>> precision mouse devices. Currently we have only private API in our JBR but
>> we’re going to discuss it on OpenJDK alias a bit later. This work is driven
>> by Denis Konoplev. He’ll provide some more technical info soon.
>>
>> Best Regards,
>> Alexey
>>
>>
>> > On 12 Jan 2020, at 03:22, Sergey Bylokhov <[email protected]>
>> wrote:
>> >
>> > Hi, Pavel.
>> >
>> > On 1/5/17 8:21 am, Pavel Fatin wrote:
>> >> Thus, 2 of the 3 major OSes already provide absolute scrolling deltas
>> – that's an additional argument in favor of the Java's MouseWheelEvent
>> enhancement.
>> >
>> > After some period of time can you please share how the solution above
>> has recommended itself.
>> >
>> >> Besides, it seems plausible that Linux will also embrace this trend
>> and include absolute scrolling deltas in XInput2 and (especially) libinput.
>> >
>> > Did something similar was implemented on Linux?
>> >
>> >
>> > --
>> > Best regards, Sergey.
>>
>
> <[email protected]>
>
>

Reply via email to