RFR: 8273485: Deadlock when also using Swing and exiting Fullscreen on Mac [v6]
Kevin Rushforth
kcr at openjdk.java.net
Thu Oct 14 14:24:56 UTC 2021
On Tue, 28 Sep 2021 12:07:36 GMT, Florian Kirmaier <fkirmaier at openjdk.org> wrote:
>> When using Swing it's possible to generate a Deadlock.
>> It's related to the nested eventloop started in enterFullScreenExitingLoop - and the RenderLock aquired when using setView in Scene.
>> Sample Programm and Threaddump are added to the ticket.
>>
>> Removing the nested loop fixes the Problem.
>> I hope this doesn't have any side effect - so far i don't know of any.
>
> Florian Kirmaier has updated the pull request incrementally with one additional commit since the last revision:
>
> JDK-8273485
> removed the toggle fullscreen before closing - to avoid the beep and improve the user experience
The latest version of the fix looks better. There is only one remaining problem that I see: If an application calls `Platform.exit()` while in full-screen mode the following exception will be thrown and printed to the console:
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException: Cannot invoke "com.sun.glass.ui.Application.staticScreen_getScreens()" because the return value of "com.sun.glass.ui.Application.GetApplication()" is null
at javafx.graphics at 18-internal/com.sun.glass.ui.Screen.initScreens(Screen.java:410)
at javafx.graphics at 18-internal/com.sun.glass.ui.Screen.notifySettingsChanged(Screen.java:379)
This will happen regardless of whether full-screen was entered via the green full-screen button, or by a call to `Stage::setFullScreen(true)`. The easiest way to reproduce this is with the `HelloFullscreen` test program, which is in `apps/toys/Hello`:
1. Run `java hello.HelloFullscreen`
2. Press the `Exit` button.
If instead you either press the `Close` button (which hides the stage) or use the red X in the window decoration, the application closes without throwing the exception.
-------------
PR: https://git.openjdk.java.net/jfx/pull/622
More information about the openjfx-dev
mailing list