JavaFX 21 Mouse Scroll Wheel Only Moving In One Direction on Linux Mint 21

78 Views Asked by At

I have a Java 8 JavaFX app that works fine on Ubuntu and Linux Mint 21. However on migrating to Java 21 and JavaFX 21 I've found that the mouse scroll wheel only works in one direction.

I found a comment in another forum post that others have seen this issue and is related to Java and gtk:

https://support.motivewave.com/forum/index.php?threads/motivewave-and-linux-performance-improvements.765/

I also found this OpenJDK post that support for GTK version 2 has now been dropped from JavaFX as of December 2020:

https://bugs.openjdk.org/browse/JDK-8277962

I actually tried adding the runtime option -Djdk.gtk.version=2 but get the warning:

WARNING: A command line option tried to seleet the GTK 2 library, which was remove from JavaFX. The GTK 3 library will be used instead.

OK - But how do I get back the correct behaviour of the mouse scroll wheel with Java/JavaFX 21 on Linux?

1

There are 1 best solutions below

1
On

Posting this as an answer because this system doesn't allow me to add the link as a comment.

A link to others experiencing the mouse scroll wheel issue and use of the flag GDK_CORE_DEVICE_EVENTS=1:

https://www.linuxquestions.org/questions/slackware-14/gtk-3-mouse-wheel-doesn't-work-on-current-wed-sep-25-a-4175478706/