RFR: 8344372: Setting width for TRANSPARENT Stage -> gtk_window_resize: assertion 'height > 0' [v8]

Kevin Rushforth kcr at openjdk.org
Wed Dec 4 20:54:51 UTC 2024


On Tue, 3 Dec 2024 22:59:20 GMT, Thiago Milczarek Sayao <tsayao at openjdk.org> wrote:

>> The bug happened when setting only width or height (not both) on a Stage that was oriented by the view size.
>> 
>> The fix just uses the previous value for width/height if not set.
>> 
>> The test class is designed to accept more test cases in the "mixed sizing" scenarios.
>
> Thiago Milczarek Sayao has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Move it to a Robot test
>  - Fix test to fail without the fix

The updated test looks good. It is stable on both my systems and it reliably catches the error.

I left a couple minor suggestions and will reapprove if you decide to make changes.

tests/system/src/test/java/test/robot/javafx/stage/StageMixedSizeTest.java line 61:

> 59:         final int finalWidth = 200;
> 60: 
> 61:         setupContentSizeTestStage(300, 300,

Minor: consider using a final variable for the initial size

tests/system/src/test/java/test/robot/javafx/stage/StageMixedSizeTest.java line 67:

> 65:         assertTrue(latch.await(TIMEOUT, TimeUnit.MILLISECONDS), "Timeout waiting for test stage to be shown");
> 66: 
> 67:         runAndWait(() -> assertColorDoesNotEqual(BACKGROUND_COLOR, getColor(290, 100), TOLERANCE));

Minor: consider deriving the x pos as initial size - 10

tests/system/src/test/java/test/robot/javafx/stage/StageMixedSizeTest.java line 102:

> 100:     }
> 101: 
> 102: 

Minor: extra blank line can be removed

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

Marked as reviewed by kcr (Lead).

PR Review: https://git.openjdk.org/jfx/pull/1654#pullrequestreview-2479738509
PR Review Comment: https://git.openjdk.org/jfx/pull/1654#discussion_r1870179525
PR Review Comment: https://git.openjdk.org/jfx/pull/1654#discussion_r1870181283
PR Review Comment: https://git.openjdk.org/jfx/pull/1654#discussion_r1870209730


More information about the openjfx-dev mailing list