On Fri, 19 Feb 2021 16:26:50 GMT, Alexander Scherbatiy <alex...@openjdk.org> 
wrote:

>> I have Touchscreen only on Raspberry Pi so I checked the touch events only 
>> on JavaFX on arm with Monocle and GTK.
>> 
>> I also checked the fix with   ScrollPaneControlsSample on Linux and Windows 
>> with ordinary screen and using only mouse (press, release, scroll) and the 
>> sample works with and without the fix.
>> 
>> I run all but webkit automated tests with the fix on Ubuntu `gradle test` 
>> and they passed.
>> I will look the way to provide an automated test.
>> 
>> I am interested if there is a better way to fix this. Handling scroll event 
>> would be straightforward (because the ScrollPane is used)  but unfortunately 
>> it does not work when two controls are scrolled.
>
> Some more details about handled events in ScrollPaneSample
> Monocle.
> 
> Touch and release a button (press a button by touching the screen)
> [button behavior] MOUSE_ENTERED, Button: 2
> [button behavior] MOUSE_PRESSED, Button: 2
> [button behavior] MOUSE_RELEASED, Button: 2
> 
> Scroll a button:
> [button behavior] MOUSE_PRESSED, Button: 3
> [button behavior] SCROLL, Button: 3
> [button behavior] MOUSE_DRAGGED, Button: 3
> [button behavior] SCROLL, Button: 3
> [button behavior] MOUSE_DRAGGED, Button: 3
> [button behavior] SCROLL, Button: 3
> [button behavior] MOUSE_DRAGGED, Button: 3
> [button behavior] SCROLL, Button: 3
> [button behavior] MOUSE_DRAGGED, Button: 3
> [button behavior] MOUSE_RELEASED, Button: 3
> 
>  Scroll a button that the next button appears under the finger:
> [button behavior] MOUSE_ENTERED, Button: 5
> [button behavior] MOUSE_PRESSED, Button: 5
> [button behavior] SCROLL, Button: 4
> [button behavior] MOUSE_DRAGGED, Button: 5
> [button behavior] SCROLL, Button: 4
> [button behavior] MOUSE_DRAGGED, Button: 5
> [button behavior] SCROLL, Button: 4
> [button behavior] MOUSE_DRAGGED, Button: 5
> [button behavior] SCROLL, Button: 4
> [button behavior] MOUSE_DRAGGED, Button: 5
> [button behavior] SCROLL, Button: 4
> [button behavior] MOUSE_DRAGGED, Button: 5
> [button behavior] SCROLL, Button: 4
> [button behavior] MOUSE_DRAGGED, Button: 5
> [button behavior] SCROLL, Button: 4
> [button behavior] MOUSE_DRAGGED, Button: 5
> [button behavior] MOUSE_RELEASED, Button: 5
> Note: all scroll events go to Button 4 but mouse is released on Button 5.
> 
> GTK
> Touch and release a button (press a button by touching the screen)
> [button behavior] MOUSE_PRESSED, Button: 1
> [button behavior] MOUSE_DRAGGED, Button: 1
> [button behavior] MOUSE_DRAGGED, Button: 1
> [button behavior] MOUSE_RELEASED, Button: 1
> Note: mouse drag events are generated
> 
> Scroll buttons by mouse (scrolling by touch does not work for me on GTK even 
> with `-Dgtk.com.sun.javafx.gestures.scroll=true` option)
> [button behavior] MOUSE_EXITED, Button: 3
> [button behavior] MOUSE_ENTERED, Button: 4
> [button behavior] SCROLL, Button: 4
> [button behavior] SCROLL, Button: 4
> [button behavior] SCROLL, Button: 4
> [button behavior] SCROLL, Button: 4
> [button behavior] MOUSE_EXITED, Button: 4
> [button behavior] MOUSE_ENTERED, Button: 5

May be it has sense to add a drag event handler (which disarms the 
corresponding button) to ButtonBehavior only if javafx.platform is monocle to 
localize the fix only for Monocle. Or add a separate property and set it by 
default to true on Monocle and to false otherwise.

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

PR: https://git.openjdk.java.net/jfx/pull/406

Reply via email to