<div dir="ltr">Thanks Johan.<div><br></div><div>I have tested this change with a jpackaged application, and the issue no longer appears. Platform.exit() now exits the application properly.</div><div><br></div><div>Craig</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 10, 2024 at 1:45 PM Johan Vos <<a href="mailto:johan.vos@gluonhq.com">johan.vos@gluonhq.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Craig,<div><br></div><div>Thanks for testing and for the feedback. Based on that feedback, I pushed a change so that the HeadlessApplication now responds properly to a `Platform.exit()` call (see <a href="https://github.com/openjdk/jfx-sandbox/commit/5c8bcb2ca1f7a72f34c3e53e209b818abf8f8504" target="_blank">https://github.com/openjdk/jfx-sandbox/commit/5c8bcb2ca1f7a72f34c3e53e209b818abf8f8504</a>).</div><div>My implementation does a gentle stop of the processing thread, and already submitted runnables will be handled before the processing halts. I think this is how it should be, and it works with a simple application, but I didn't test it with a jpackaged application yet. It would be great if you can confirm that this is now fixed?</div><div><br></div><div>Thanks again for the feedback!</div><div><br></div><div>- Johan</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 9, 2024 at 11:37 AM Craig Raw <<a href="mailto:craigraw@gmail.com" target="_blank">craigraw@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Johan,<div><br></div><div>As you advised in another thread, I've tested the headless glass platform and find it to be an excellent solution. My particular use case is to provide an alternative terminal interface (using Lanterna) for a JavaFX application without needing to rewrite a great deal of the logic. For this purpose, the headless glass platform works very well as a replacement to Monocle.</div><div><br></div><div>I encountered only one problem - calling Platform.exit() did not terminate the application after it had been packaged with jpackage. This did not occur with the same code using the JavaFX18 Monocle libraries on Linux amd64. The JavaFX application thread was the only non-daemon thread at this point. I solved this fairly simply by calling System.exit(0) after Platform.exit().</div><div><br></div><div>As an aside, I was impressed by how simple it was to build JavaFX. I was surprised though that javafx.graphics.jar did not contain the native libraries, and I had to repackage the jar to include them manually. There are probably good reasons for this, but it wasn't obvious.</div><div><br></div><div>It would be really good to see the headless glass platform merged into JavaFX proper, and would allow me to move beyond JavaFX 18, the last version to have Monocle support for Linux amd64. </div><div><br></div><div>Craig</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 2, 2024 at 10:50 AM Marius Hanl <<a href="mailto:mariushanl@web.de" target="_blank">mariushanl@web.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:Verdana;font-size:12px"><div>I agree that this a nice feature, especially for headless tests as you also mentioned.</div>
<div>Really looking forward to this feature.</div>
<div> </div>
<div>- Marius</div>
<div>
<div>
<div name="quote" style="margin:10px 5px 5px 10px;padding:10px 0px 10px 10px;border-left:2px solid rgb(195,217,229)">
<div style="margin:0px 0px 10px"><b>Gesendet:</b> Dienstag, 30. Januar 2024 um 12:46 Uhr<br>
<b>Von:</b> "Johan Vos" <<a href="mailto:johan.vos@gluonhq.com" target="_blank">johan.vos@gluonhq.com</a>><br>
<b>An:</b> "openjfx-dev" <<a href="mailto:openjfx-dev@openjdk.org" target="_blank">openjfx-dev@openjdk.org</a>><br>
<b>Betreff:</b> Headless glass platform</div>
<div name="quoted-content">
<div>
<div>Hi,</div>
<div> </div>
<div>I created a branch in the jfx-sandbox repository for experimenting with a headless glass platform: <a href="https://github.com/openjdk/jfx-sandbox/tree/johanvos-headless" target="_blank">https://github.com/openjdk/jfx-sandbox/tree/johanvos-headless</a></div>
<div> </div>
<div>This addresses <a href="https://bugs.openjdk.org/browse/JDK-8324941" target="_blank">https://bugs.openjdk.org/browse/JDK-8324941</a> where I suggest a POC for a Headless platform.</div>
<div> </div>
<div>There are a number of usecases for this, including:<br>
1. applications that require JavaFX rendering without presenting this to a window (and instead send it to a printer for example)</div>
<div>2. running tests without requiring a window manager.</div>
<div> </div>
<div>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.</div>
<div> </div>
<div>By using a first-class Headless glass platform instead of a Monocle subplatform, it should be easier to use by developers.</div>
<div>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.</div>
<div> </div>
<div>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.</div>
<div> </div>
<div>- Johan</div>
<div> </div>
</div>
</div>
</div>
</div>
</div></div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>