<AWT Dev> Update to the proposal on enhancing MouseWheelEvent

Pavel Fatin pavel.fatin at jetbrains.com
Thu Jan 16 13:37:49 UTC 2020


As described in https://pavelfatin.com/scrolling-with-pleasure/#linux and
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

Most modern APIs and toolkits do support pixel deltas, e.g.:
* Qt: https://doc.qt.io/qt-5/qwheelevent.html#pixelDelta
* GTK:
* JavaFX:
* DOM Level 3 (web browsers):

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.


On Wed, Jan 15, 2020 at 1:00 PM Denis Konoplev <denis.konoplev at jetbrains.com>

> 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 <alexey.ushakov at jetbrains.com>
>> Date: Mon, Jan 13, 2020 at 12:19 PM
>> Subject: Re: <AWT Dev> Update to the proposal on enhancing MouseWheelEvent
>> To: Sergey Bylokhov <Sergey.Bylokhov at oracle.com>
>> Cc: Denis Konoplev <dekonoplyov at gmail.com>, Pavel Fatin <
>> pavel.fatin at jetbrains.com>, <awt-dev at openjdk.java.net>
>> 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 <Sergey.Bylokhov at oracle.com>
>> 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.
> <denis.konoplev at jetbrains.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/awt-dev/attachments/20200116/c8c4916a/attachment.htm>

More information about the awt-dev mailing list