On Mon, 9 Jun 2025 16:32:45 GMT, Michael Strauß <[email protected]> wrote:
> > So I don't know if there's a bug worth investigating here or not, these
> > comments are mainly intended as a source of information to others.
>
> This seems like a bug. If developers use an API wrongly, a clearly defined
> error should result; in this case, window buttons disappear or stop working.
> This can't be right.
>
> Is the software you're talking about open source, or can you reproduce the
> issue with ControlFx in a standalone app?
I've narrowed it down to this, which is much simplified version of what my code
+ ControlsFX was doing; it consistently reproduces the issue.
No third party libs needed.
public class DisappearingWindowIcons extends Application {
@Override
public void start(Stage stage) {
BorderPane root = new BorderPane();
root.setTop(new HeaderBar());
Button button = new Button("Click me for "bug" (hover of window icons
after)!");
button.setOnAction(_ -> bug(root));
root.setCenter(button);
stage.setScene(new Scene(root, 300, 200));
stage.initStyle(StageStyle.EXTENDED);
stage.show();
}
public void bug(Pane parentPane) {
StackPane stackPane = new StackPane();
Parent originalParent = parentPane.getScene().getRoot();
parentPane.getScene().setRoot(stackPane);
stackPane.getChildren().addFirst(originalParent);
}
}
Note that I see some CSS errors, that weren't being logged before for me (at
least not consistently, though I did see them):
> WARNING: Caught 'java.lang.ClassCastException: class java.lang.String cannot
> be cast to class javafx.scene.paint.Paint (java.lang.String is in module
> java.base of loader 'bootstrap'; javafx.scene.paint.Paint is in module
> javafx.graphics@25-internal of loader 'app')' while converting value for
> '-fx-background-color' from rule '*.button' in stylesheet
> jar:file:///C:/Users/credm/.m2/repository/org/openjfx/javafx-controls/25-internal+0-2025-06-06-234837/javafx-controls-25-internal+0-2025-06-06-234837-win.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1605#issuecomment-2957015764