On Sun, 21 Jun 2026 15:45:14 GMT, Marius Hanl <[email protected]> wrote:

> Tests for the fix made in https://github.com/openjdk/jfx/pull/2171.
> 
> I figured out that `ScrollEventTest` already has a way to test `Scene` 
> `ScrollEvent`s.
> This is done by invoking the `ScenePeerListener.scrollEvent(..)` method in 
> the tests.
> 
> This is the very same way the `GlassViewEventHandler` will do in a normal 
> application (which is usually invoked from 
> `com.sun.glass.ui.View.notifyScroll(..)`).
> 
> cc @beldenfox 
> This tests the picked `Node` and the `Scene`, if there is no `Node` to pick. 
> ~Let me know what you think, I will create a ticket if this is fine!~ Done.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Thanks for tracking this down and writing up these tests. I really appreciate 
it. Let me know if there's anything I can do to get this code tested and 
approved.

At first glance the tests look fine but I haven't done a line-by-line review. 
The testScrollInertiaRetargetedToPickedNodeWhenTargetRemovedFromScene test 
covers the case where the user quickly flicks the scroll wheel and most of the 
scrolling occurs in the inertia phase. The user can also scroll by moving their 
finger up and down without ever lifting it from the trackpad. The sequence 
there would be:

1. SCROLL_STARTED
2. SCROLL
3. first target removed from scene
4. SCROLL
5. SCROLL_FINISHED

The SCROLL event in step 4 should also get re-targeted to a new node. You might 
consider adding another test case or expanding the one you have to include this.

-------------

PR Comment: https://git.openjdk.org/jfx/pull/2194#issuecomment-4774243904

Reply via email to