Headless glass platform
Johan Vos
johan.vos at gluonhq.com
Wed Jan 31 09:24:27 UTC 2024
On Tue, Jan 30, 2024 at 5:14 PM Andy Goryachev <andy.goryachev at oracle.com>
wrote:
> Excellent development, Johan, thank you!
>
>
>
> I’ve asked a few questions in the ticket
> https://bugs.openjdk.org/browse/JDK-8324941
>
>
>
> I suppose I should also do it here:
>
>
>
> - How do you get information on a (virtual) screen?
> - How would one control how many virtual screens are there?
>
Good questions. This is currently hardcoded in
HeadlessApplication.staticScreen_getScreens() but that can be extended to
take input via environment variables or System properties.
> - Would there be any other way of simulating user input apart from Robot?
>
Not sure I understand the question. In theory, input with mouse etc would
be possible but then that would be sort of a duplication/rewrite of the
Robot. I'm missing the usecase for this I guess?
> - Is the graphics still accelerated?
>
Yes, the headless platform does not influence the prism settings. If will
still use the hw acceleration by default, and fall back to sw-rendering if
hw fails, or if prism.order is set to explicitly use sw rendering.
> - Are there any functional gaps between Headless and headful modes (fonts,
> rendering, etc.)?
>
Not as far as I know, as that functionality is not in Glass.
>
> Most importantly,
> - Is there a JEP/tutorial for the new mode?
>
>
>
> Thank you
>
> -andy
>
>
>
>
>
> *From: *openjfx-dev <openjfx-dev-retn at openjdk.org> on behalf of Johan Vos
> <johan.vos at gluonhq.com>
> *Date: *Tuesday, January 30, 2024 at 03:47
> *To: *openjfx-dev <openjfx-dev at openjdk.org>
> *Subject: *Headless glass platform
>
> Hi,
>
>
>
> I created a branch in the jfx-sandbox repository for experimenting with a
> headless glass platform:
> https://github.com/openjdk/jfx-sandbox/tree/johanvos-headless
>
>
>
> This addresses https://bugs.openjdk.org/browse/JDK-8324941 where I
> suggest a POC for a Headless platform.
>
>
>
> There are a number of usecases for this, including:
> 1. applications that require JavaFX rendering without presenting this to a
> window (and instead send it to a printer for example)
>
> 2. running tests without requiring a window manager.
>
>
>
> Regarding the second usecase, we already did some basic experiments using
> a modified version of TestFX where instead of the Monocle Headless
> subplatform, the POC Headless platform is used.
>
>
>
> By using a first-class Headless glass platform instead of a Monocle
> subplatform, it should be easier to use by developers.
>
> The monocle code contains very platform/os specific parts, which often
> don't make sense outside the target platform. This is very valuable, but it
> is also a very different usecase than a headless platform and it requires a
> much more complex build procedure.
>
>
>
> I added an initial, limited HeadlessRobot to do some basic tests. That
> code is mainly taken from the existing Monocle implementation, but I want
> to be careful to avoid anything that is not applicable to the headless
> scenarios.
>
>
>
> - Johan
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20240131/17e9ad53/attachment-0001.htm>
More information about the openjfx-dev
mailing list