RFC: Smooth scrolling support in sun.awt.X11

Philip Race philip.race at oracle.com
Fri Feb 23 04:11:25 UTC 2024


First, thank you for raising it this way rather than submitting a PR !

In general things that compatibly and safely improve the user experience 
are welcome.

So at a high level, yes. So the next level is the details to think about 
it more ?

How important is smooth scrolling ? I've never noticed not having it. 
Does it imply more ?

How much of this is useful without adding new API and therefore 
applicable to 10 year old applications ?

You speak of X11, but what about mac and windows ?

And even for X11, we are (very slowly !) moving towards Wayland for the 
future, so if this is just an X11-specific
implementation stop-gap, is it worth the effort ?

If it is a contained, low risk, implementation only change, with no 
changes to apps and benefits to users,
those are all good signs.

I invite others to chime in, especially anyone who knows something about 
this X11 extension.

-phil


On 2/22/24 6:23 PM, Povilas Kanapickas wrote:
> 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