RFR: 8326619: Stage.sizeToScene() on maximized/fullscreen Stage breaks the Window [v3]

Marius Hanl mhanl at openjdk.org
Thu May 23 13:51:09 UTC 2024


On Tue, 30 Apr 2024 23:20:59 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

> * 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.

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

PR Comment: https://git.openjdk.org/jfx/pull/1382#issuecomment-2127160594


More information about the openjfx-dev mailing list