RFC: Smooth scrolling support in sun.awt.X11

Povilas Kanapickas povilas at radix.lt
Fri Feb 23 02:23:46 UTC 2024


Hello,

I would like to add smooth scrolling support to sun.awt.X11. At this
point of time I already have this feature implemented. The code can be
considered proof of concept right now, but it works and doesn't
introduce regressions in all test scenarios I've done so far.

Is this something that The Client Libraries Group would be interested in?

The implementation consists of two parts.

The first is adding support for X Input Extension 2.x protocol (XInput2)
to sun.awt.X11. This protocol is quite different from the core X
protocol that is currently used for input. Fortunately, it is possible
to map XInput2 events back to core X input events almost exactly. Thus
the addition for this new protocol involves relatively few code changes.
Different functions need to be called here and there, but the bulk of
code is reused as is by converting XInput2 events to core X input
events. This reduces the risk of any regressions significantly.

The second part is relatively simple wiring of XInput2 smooth scrolling
events to MouseWheelEvent.

This work would also lay ground for supporting gestures such as swipe or
rotate on X11. This could be useful when these gestures are exposed in
awt in the future. I implemented support for these gestures in the X
server a couple of years ago and could potentially help exposing them in
awt on macos and x11 too.

Please let me know what you think about all this on a high level.

Thank you,
Povilas Kanapickas


More information about the client-libs-dev mailing list