RFR: 8326619: Stage.sizeToScene() on maximized/fullscreen Stage breaks the Window
Marius Hanl
mhanl at openjdk.org
Thu May 23 12:45:09 UTC 2024
On Fri, 8 Mar 2024 16:39:56 GMT, Marius Hanl <mhanl at openjdk.org> wrote:
>> This seems like a reasonable fix and spec change. Have you tested the case of calling sizeToScene before setting full-screen or maximzed? Since the pending flag will still be set in that case, I want to make sure that case is tested as well.
>>
>> Also, if this fixed [JDK-8316425](https://bugs.openjdk.org/browse/JDK-8316425), then that bug should be closed as a duplicate of this one.
>>
>> @lukostyra @arapte can you also review this?
>
>> This seems like a reasonable fix and spec change. Have you tested the case of calling sizeToScene before setting full-screen or maximzed? Since the pending flag will still be set in that case, I want to make sure that case is tested as well.
>
> I thought about this as well but could not find any problem at least on Windows.
> If we want to be perfectly safe, we may still want to set the flag when `sizeToScene()` is called. What do you think?
>
> I used the following code to test this, and it didn't matter when `sizeToScene()` was called:
>
>
> @Override
> public void start(Stage primaryStage) throws Exception {
> StackPane root = new StackPane();
> Button wss = new Button("Wss");
> wss.setPrefSize(50, 50);
> root.getChildren().add(wss);
>
> Scene scene = new Scene(root);
>
> Stage stage = new Stage();
> stage.setWidth(500);
> stage.setMaximized(true);
> stage.sizeToScene();
> stage.setScene(scene);
> stage.show();
> }
> @Maran23 I think this is pretty close to being ready to go in. At a minimum, you will need to merge master and then fix the test so that it will compile, and then create a CSR with the updated specification (I can help with that if needed). My only other suggestion was around additional tests that might be useful, but they could be done as a follow-on fix.
Yes, sure, I've just been very busy with my day job over the last few weeks. I hopefully have more time now though :)
And I totally agree with writing more tests, always good to have and to ensure quality. So no need for a follow-on ticket.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1382#issuecomment-2127013006
More information about the openjfx-dev
mailing list