RFR: 8355990: [macOS] Restoring a maximized stage does not update the window size [v2]
Andy Goryachev
angorya at openjdk.org
Wed Aug 6 17:46:21 UTC 2025
On Wed, 6 Aug 2025 13:53:08 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> Martin Fox has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Cleaned up diff against master. Tighted up system test (tested on Windows and Linux)
>
> tests/system/src/test/java/test/javafx/stage/RestoreStagePositionTest.java line 130:
>
>> 128:
>> 129: Util.runAndWait(() -> stage.setMaximized(true));
>> 130: Util.waitForIdle(stage.getScene());
>
> I know that @andy-goryachev-oracle suggested its use, but for tests that do various windowing operations (maximize, full screen, restore, etc), `waitForIdle` is too short (its on the order of 160 msec). To make the test more robust, I recommend reverting this back to the `sleep(800)` you had earlier.
>
> Arguably, we should have a utility method for this sort of "wait for windowing changes to settle down", but we don't.
There is `Util::waitForIdle(scene, pulseCount)`.
The real question is how to account for the platform-dependent transitions (which may take some time) reliably. Waiting for a set amount of time might work, but we have to pick a good timeout value. Is there any other possibility?
I am ok with 800ms - it feels like it should be long enough for any transition to take place.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1860#discussion_r2257869423
More information about the openjfx-dev
mailing list