RFR: 8324941: POC for Headless platform for JavaFX [v7]

Jose Pereda jpereda at openjdk.org
Mon Jul 7 14:19:52 UTC 2025


On Mon, 7 Jul 2025 09:29:22 GMT, Johan Vos <jvos at openjdk.org> wrote:

>> After spending a year in the sandbox repository, the Headless Platform is now ready to be reviewed in the main repository.
>> 
>> ### the Headless Platform
>> The Headless Platform is a top-level com.sun.glass.ui platform that replaces the second-level Monocle-Headless subplatform, that is part of the top-level Monocle platform. 
>> The platform can be used like any other platform, especially for running headless JavaFX applications, or for running tests (e.g. on CI systems)
>> 
>> ### changes
>> The code for the Headless Platform is in a new package com.sun.glass.ui.headless in the javafx.graphics module, and it does not require a code change in other packages.
>> This PR adds a simple change in the `build.gradle` file, to make the Headless Platform the standard when running headless tests (instead of using Monocle/Headless)
>> 
>> ### enable the Headless Platform
>> Setting the system property `glass.platform` to `Headless` will select the Headless Platform instead of the default one (either gtk, mac or win).
>> 
>> ### testing
>> `gradlew --info -PHEADLESS_TEST=true -PFULL_TEST=true :systemTests:cleanTest :systemTests:test`
>> runs all the system tests, apart from the robot tests. There are 2 failing tests, but there are valid reasons for those to fail.
>> 
>> ### robot tests
>> Most of the robot tests are working on headless as well. add `-PUSE_ROBOT` to test those.
>
> Johan Vos has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Process more reviewer comments

modules/javafx.graphics/src/main/java/com/sun/glass/ui/headless/HeadlessRobot.java line 129:

> 127:         view.notifyMouse(MouseEvent.DOWN, getGlassEventButton(buttons), (int)mouseX-wx, (int)mouseY-wy, (int)mouseX, (int)mouseY, modifiers, true, true);
> 128:         int buttonCode = getGlassEventButton(buttons);
> 129:         view.notifyMouse(MouseEvent.DOWN, buttonCode, (int)mouseX-wx, (int)mouseY-wy, (int)mouseX, (int)mouseY, modifiers, true, true);

This code (`view.notifyMouse(...`) is duplicated, and there are two notifications of mouse down while there should be just one.

The first line can be removed.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1836#discussion_r2190246607


More information about the openjfx-dev mailing list