RFR: 8364687: Enable headless with -Dglass.platform=headless [v2]

Johan Vos jvos at openjdk.org
Thu Aug 14 09:48:24 UTC 2025


On Wed, 6 Aug 2025 21:08:30 GMT, Clément de Tastes <duke at openjdk.org> wrote:

>> Clément de Tastes has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   remove additional space
>
> `com.sun.javafx.PlatformUtil::isHeadless` returns `true` for any case matching `"headless"`, which is not what i provided in my original suggestion.
> So maybe we could reuse it :
> 
> 
>             if (userPlatform != null) {
>                 if (userPlatform.equals("macosx"))
>                     type = MAC;
>                 else if (userPlatform.equals("windows"))
>                     type = WINDOWS;
>                 else if (userPlatform.equals("linux"))
>                     type = GTK;
>                 else if (userPlatform.equals("gtk"))
>                     type = GTK;
>                 else if (userPlatform.equals("ios"))
>                     type = IOS;
>                 else
>                     if (PlatformUtil.isHeadless())
>                         type = HEADLESS;
>                     else
>                         type = userPlatform;
>                 return type;
>             }
> 
> 
> Makes the code a bit clumsy to me, but has the benefit of reusing logic.

@CodeSimcoe Feel free to integrate this PR at your convenience.

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

PR Comment: https://git.openjdk.org/jfx/pull/1864#issuecomment-3187820961


More information about the openjfx-dev mailing list