RFR: 8087980: Add property to disable Monocle cursor
John Neffenger
github.com+1413266+jgneff at openjdk.org
Wed Nov 13 21:34:06 UTC 2019
On Tue, 8 Oct 2019 12:03:42 GMT, Dell Green <12861109+dellgreen at users.noreply.github.com> wrote:
> Often on embedded systems a cursor is not a valid input modality. On some of these systems, when the javafx toolkit initialises the native hardware cursor, it produces artefacts which can be seen on screen (in the framebuffer for example). This change adds a system property "monocle.cursor.enabled" that can disable the creation of a native cursor in each of the Monocle NativePlatform implementations in favour of a NullCursor which is a no-op implementation of the NativeCursor abstract class that all native cursors have to implement.
>
> NullCursor class already existed and was being returned for some implementations like AndroidPlatform and HeadlessPlatform. This change builds upon that and conditionally returns NullCursor for all platforms.
>
> A system property "monocle.debugcursor" has also been added to turn on logging of which NativeCursor has been selected when the toolkit initialises.
>
> ----------------
>
> Commits:
> - cfbbc7dd: JDK-8087980: Add property to disable Monocle cursor
>
> Changes: https://git.openjdk.java.net/jfx/pull/5/files
> Webrev: https://webrevs.openjdk.java.net/jfx/5/webrev.00
> Issue: https://bugs.openjdk.java.net/browse/JDK-8087980
> Stats: 49 lines in 8 files changed: 40 ins; 0 del; 9 mod
> Patch: https://git.openjdk.java.net/jfx/pull/5.diff
> Fetch: git fetch https://git.openjdk.java.net/jfx pull/5/head:pull/5
modules/javafx.graphics/src/main/java/com/sun/glass/ui/monocle/NativePlatform.java line 50:
> 49: AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> {
> 50: final String str =
> 51: System.getProperty("monocle.debugcursor", "");
Just a nit, but why `monocle.debugcursor` rather than `monocle.cursor.debug` (my preference), or at least `monocle.debugCursor`? Below is the full list, for comparison, including the two added by this pull request.
monocle.cursor.enabled
monocle.debugcursor
monocle.epd.bitsPerPixel
monocle.epd.enableInversion
monocle.epd.forceMonochrome
monocle.epd.noWait
monocle.epd.rotate
monocle.epd.useDitheringY1
monocle.epd.useDitheringY4
monocle.epd.waveformMode
monocle.epd.y8inverted
monocle.input.<product>.flipXY
monocle.input.<product>.maxX
monocle.input.<product>.maxY
monocle.input.<product>.minX
monocle.input.<product>.minY
monocle.input.<product>.touchFilters
monocle.input.touchFilters
monocle.input.touchRadius
monocle.input.traceEvents
monocle.input.traceEvents.verbose
monocle.maliSignedStruct
monocle.platform
monocle.platform.traceConfig
monocle.screen.fb
monocle.stackSize
I'm nervous about our hidden API of system properties, and I'm as guilty as anyone with the nine properties I added for Monocle EPD. I think it might be okay as long as the code gets the property values only during class initialization. That should restrict their use to startup scripts and keep them out of application code trying to modify them *on-the-fly* at run time.
PR: https://git.openjdk.java.net/jfx/pull/5
More information about the openjfx-dev
mailing list