RFR: 8326619: Stage.sizeToScene() on maximized/fullscreen Stage breaks the Window [v3]
Kevin Rushforth
kcr at openjdk.org
Wed Jun 5 22:42:50 UTC 2024
On Thu, 23 May 2024 13:48:48 GMT, Marius Hanl <mhanl at openjdk.org> wrote:
>> The fix looks good. The spec changes (updated javadocs) look good. Can you create the CSR for the spec change?
>>
>> I have a couple overall comments:
>>
>> * I wanted to verify different orders of operation, so I wrote a (manual) test program and attached it to the JBS bug. It covers the following cases:
>> * set ; sizeToScene ; show
>> * sizeToScene ; set ; show
>> * show ; set ; sizeToScene
>> * show ; sizeToScene ; set
>>
>> I verified that the first 3 are broken today. All cases work with your fix. I think it might be a good idea to add automated tests for the different orderings.
>>
>> * Please merge the latest master. Note that the calls to Util.shutdown in the tests must be fixed after this is done or they will no longer compile.
>
>> * I wanted to verify different orders of operation, so I wrote a (manual) test program
>
> I'm retesting and writing tests right now and reproduced one usecase out of my head that indeed 'fails' now.
> Take the following code:
>
> Button button = new Button();
> button.setMinSize(440, 440);
>
> Scene scene = new Scene(button);
> stage.setTitle("JavaFX test stage!");
> stage.setScene(scene);
>
> stage.setWidth(50);
> stage.setHeight(50);
>
> stage.setFullScreen(true);
> stage.sizeToScene();
> stage.setFullScreen(false);
>
> stage.show();
>
>
> With my logic, the `sizeToScene()` flag is not remembered, so the scene is not adjusted in the `sizeToScene` style after I 'go out' of fullscreen mode.
>
> If I do instead:
>
> stage.sizeToScene();
> stage.setFullScreen(true);
> stage.setFullScreen(false);
>
>
> The flag is remembered and the scene has the size of the button. Not sure what the expectation is here, but we could fix this problem by still remembering the flag if called.
@Maran23 Can you create the CSR? The updated docs (with the small suggestion I made) look ready.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1382#issuecomment-2151077735
More information about the openjfx-dev
mailing list