RFR: 8176813: Mac: Failure to exit full-screen programmatically in some cases [v2]
Andy Goryachev
angorya at openjdk.org
Tue Apr 29 17:42:50 UTC 2025
On Tue, 29 Apr 2025 17:29:26 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.
>
> Martin Fox has updated the pull request incrementally with one additional commit since the last revision:
>
> Fixed typo, re-enabled maximized position test on macOS.
I modified the reproducer to invoke each test 10 times:
public static void launch() throws Exception {
initFX();
try {
Stage_RestorePosition_8176813 test = new Stage_RestorePosition_8176813();
t(() -> test.testUnfullscreenPosition());
t(() -> test.testDemaximizedPosition());
} catch (Throwable e) {
e.printStackTrace();
} finally {
teardown();
}
}
interface Ru {
public void run() throws Exception;
}
static void t(Ru r) throws Exception {
for (int i = 0; i < 10; i++) {
r.run();
}
}
getting an exception, intermittently, in the middle of the test:
java.lang.AssertionError: Assertion failed: expected true, was false
at andy_test/goryachev.bugs.Stage_RestorePosition_8176813.fail(Stage_RestorePosition_8176813.java:70)
at andy_test/goryachev.bugs.Stage_RestorePosition_8176813.assertTrue(Stage_RestorePosition_8176813.java:75)
at andy_test/goryachev.bugs.Stage_RestorePosition_8176813.testUnfullscreenPosition(Stage_RestorePosition_8176813.java:129)
at andy_test/goryachev.bugs.Stage_RestorePosition_8176813.lambda$0(Stage_RestorePosition_8176813.java:50)
at andy_test/goryachev.bugs.Stage_RestorePosition_8176813.t(Stage_RestorePosition_8176813.java:65)
at andy_test/goryachev.bugs.Stage_RestorePosition_8176813.launch(Stage_RestorePosition_8176813.java:50)
at andy_test/goryachev.apps.AppTestLauncher.main(AppTestLauncher.java:15)
see
https://github.com/andy-goryachev-oracle/Test/commit/4344eb949900642f000215625b59f10e9d737340
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1797#issuecomment-2839698724
More information about the openjfx-dev
mailing list