openjdk-jfx
openjdk-jfx copied to clipboard
Provide property to disable Monocle cursor functionality
On embedded devices, often a cursor is not a valid modality, yet a cursor is still initialised by the openjfx stack in an application. This for us is creating startup artifacts on the screen as /dev/fb1 is being used by for example MX6Cursor.java. Removing /dev/fb1 solves the problem, but an error stacktrace is printed and I'm not clear as to the ongoing implications of this on the javafx stack as it seems to be an unexpected scenario.
It would be useful to have a system property which allowed the disabling of all cursor functionality to avoid the startup overhead and screen artifacts. I am happy to work on this, but need some feedback on what classes to focus on to provide such an option
On further investigation it looks like in each of the createCursor() methods of each platform in the monocle package we could introduce a new a system property like "monocle.cursor.enable" and if false return a NullCursor instance like the HeadlessPlatform and the AndroidPlatform
On even closer inspection, it looks like it would be better to return a NullCursor implementation of Cursor at from the Application subclasses layer so that the behaviour can be consistent across, mac,win,linux,ios,gtk and monocle applications
Should solve JDK-8087980, JDK-8088412 as well as my own requirements on embedded systems.
Whilst my current solution works for monocle and GTKApplication, the Mac seems to be doing something entirely different as having a null cursor has no affect on the mac version, however on mac setting the cursor to none via the scene class does work, which seems to imply that cursor manipulation is happening somewhere other than within the glass windowing tookit package.
Will focus on Monocle as embedded is where cursor modality can be irrelevant and cause unwanted artifacts, rather than desktop where mouse and cursor is valid most of the time