RFR: 8176813: Mac: Failure to exit full-screen programmatically in some cases
Kevin Rushforth
kcr at openjdk.org
Mon Apr 28 20:25:52 UTC 2025
On Mon, 28 Apr 2025 17:47:50 GMT, Martin Fox <mfox at openjdk.org> wrote:
> On macOS the system animates the transition into and out of fullscreen and this animation runs asynchronously. JavaFX tries to make the setFullScreen call appear synchronous by running a nested event loop while the transition is going on. But this means that runLater runnables can fire during a call to setFullScreen.
>
> This can also occur during a call to Window.hide() if the window is in fullscreen mode. During the setView call glass tries to take the window out of fullscreen mode which fires up a nested event loop and, again, runLater runnables (like pulses) start firing.
>
> In this PR GlassRunnables that try to run during the fullscreen transition are instead placed in a deferral list. When the fullscreen event loop exits they are re-scheduled.
This looks like a reasonable solution. I'll put it on my review queue and also do a full headful test run later this week.
A couple quick questions:
* Do you think this will increase the possibility of deadlock?
* Will there be any problem one of the deferred Runnables causes an exitFullScreen (e.g., on a different Stage in a dual screen case)? This might be worth testing.
@andy-goryachev-oracle You might want to test this as well, if you have time.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1797#issuecomment-2836446599
More information about the openjfx-dev
mailing list