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

Johan Vos jvos at openjdk.org
Mon Jul 7 09:15:46 UTC 2025


On Fri, 27 Jun 2025 16:54:39 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> Johan Vos has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Process reviewer comments
>
> modules/javafx.graphics/src/main/java/com/sun/glass/ui/headless/HeadlessApplication.java line 22:
> 
>> 20:     private final NestedRunnableProcessor processor = new NestedRunnableProcessor();
>> 21:     private final HeadlessWindowManager windowManager = new HeadlessWindowManager();
>> 22:     private Screen[] screens = null;
> 
> minor: no need to assign null, also L24

removed.

> modules/javafx.graphics/src/main/java/com/sun/glass/ui/headless/HeadlessApplication.java line 41:
> 
>> 39:     @Override
>> 40:     protected void _invokeAndWait(Runnable runnable) {
>> 41:         throw new UnsupportedOperationException("Not supported yet.");
> 
> is there a follow-up bug for this, or the list of things to do?

I think it's best to keep this here, because in case there is somehow an invocation of this method, we want to be notified about it, and then come up with the most appropriate way to implement it.

> modules/javafx.graphics/src/main/java/com/sun/glass/ui/headless/HeadlessApplication.java line 92:
> 
>> 90:     @Override
>> 91:     protected void staticCursor_setVisible(boolean visible) {
>> 92:         throw new UnsupportedOperationException("Not supported yet.");
> 
> should it be a no-op instead?  will cursor be supported at all?

There is a Headless Cursor, but the setVisible method doesn't seem to be used in any of the tests currently.

> modules/javafx.graphics/src/main/java/com/sun/glass/ui/headless/HeadlessRobot.java line 179:
> 
>> 177:     public void getScreenCapture(int x, int y, int width, int height, int[] data, boolean scaleToFit) {
>> 178:         checkWindowFocused();
>> 179:         ((HeadlessWindow)activeWindow).getScreenCapture(x, y, width, height, data, scaleToFit);
> 
> maybe the `activeWindow` can be declared as `HeadlessWindow` to avoid casting

good idea, done

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1836#discussion_r2189445871
PR Review Comment: https://git.openjdk.org/jfx/pull/1836#discussion_r2189447802
PR Review Comment: https://git.openjdk.org/jfx/pull/1836#discussion_r2189449818
PR Review Comment: https://git.openjdk.org/jfx/pull/1836#discussion_r2189454545


More information about the openjfx-dev mailing list