RFR: 8359601: Fix window button states of an extended stage [v6]
Michael Strauß
mstrauss at openjdk.org
Tue Jun 24 15:30:37 UTC 2025
On Tue, 24 Jun 2025 08:16:48 GMT, Cormac Redmond <duke at openjdk.org> wrote:
>> Michael Strauß has updated the pull request incrementally with one additional commit since the last revision:
>>
>> fix resizable state of macOS window
>
> I have found another bug/issue, which is again related to wrapping a root node in a StackPane (something that is common in, for example, ControlsFx). Although the observed behaviour is probably strictly logically correct, I think this should be prevented (e.g, HeaderBar has/gets special meaning/treatment).
>
>
> public class DisappearingHeaderBarNodesBug extends Application {
>
> @Override
> public void start(Stage primaryStage) {
> BorderPane root = new BorderPane();
> Button button = new Button("Click for "bug()"!");
> button.setOnAction(_ -> bug(root));
> root.setCenter(new VBox(new Label("Something above"), button, new Label("Something below")));
> root.setTop(getHeaderBar());
>
> primaryStage.initStyle(StageStyle.EXTENDED);
> primaryStage.setScene(new Scene(root, 300, 200));
> primaryStage.show();
> }
>
> // Wrapping the root node in a stackpane is common
> private void bug(Pane root) {
> StackPane stackPane = new StackPane();
> root.getScene().setRoot(stackPane);
> stackPane.getChildren().addFirst(root);
> }
>
> private HeaderBar getHeaderBar() {
> HeaderBar headerBar = new HeaderBar();
> headerBar.setCenter(new Label("!!! HeaderBar !!!"));
> headerBar.setLeading(new Label("L"));
> return headerBar;
> }
>
> public static void main(String[] args) {
> launch(args);
> }
> }
>
>
> As you can see, after you click the button, and resize, the HeaderBar can disappear completely:
>
> https://github.com/user-attachments/assets/93a320a5-0010-4941-a2a4-9e0e65cbd57d
@credmond We should keep this PR focused, let's use the mailing list or JBS to discuss other issues.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1831#issuecomment-3000966509
More information about the openjfx-dev
mailing list