RFR: 8169285: Re-enable javafx.swt tests [v2]

Kevin Rushforth kcr at openjdk.org
Thu May 1 13:57:49 UTC 2025


On Wed, 30 Apr 2025 21:53:38 GMT, Marius Hanl <mhanl at openjdk.org> wrote:

> I setup an Ubuntu 24.04.2 LTS inside WSL, did export GDK_BACKEND=x11 (otherwise I always got a crash).

Interesting. The crash is likely due to [JDK-8340378](https://bugs.openjdk.org/browse/JDK-8340378). JavaFX glass calls `putenv("GDK_BACKEND=x11")` at initialization time, but this is likely too late in the case where FXCanvas is embedded in an SWT window. By that time SWT has already initialized the Gtk toolkit, so the env variable needs to be set earlier.

I will check whether this is the case by trying out HelloFXCanvas after first setting that variable. If so, then the fix for [JDK-8340378](https://bugs.openjdk.org/browse/JDK-8340378) will be to set that env variable from HelloFXCanvas when running on Linux.

Getting back to this PR For the fix will likely be to modify the test to set that env variable when running on Linux. Although, that presumes the test is stable across multiple Linux platforms.

> The tests are always green for me. Tried several times.

Since it works for you on Ubuntu 24.04, the failures I see might be specific to 22.04. We don't have a good way to check specific versions of Ubuntu Linux. I'll retest this when I have time to check the Wayland workaround on 24.04 and let you know.

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

PR Comment: https://git.openjdk.org/jfx/pull/1783#issuecomment-2844889943


More information about the openjfx-dev mailing list