On Tue, 17 Jun 2025 00:37:22 GMT, Cormac Redmond <d...@openjdk.org> wrote:
> Another suspected issue (not really related to this PR), close request > handlers are not called when using EXTENDED. E.g.: > > ``` > stage.setOnCloseRequest(event -> { > System.out.println("Never called...");; > }); > ``` > > Same for dialogs... Sample: import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.ButtonType; import javafx.scene.control.Dialog; import javafx.scene.layout.StackPane; import javafx.stage.Modality; import javafx.stage.Stage; import javafx.stage.StageStyle; public class MinimiseIconEnabledBug extends Application { @Override public void start(Stage primaryStage) { Button button = new Button("Click"); button.setOnAction(e -> { final Dialog<Object> dialog = new Dialog<>(); dialog.initOwner(primaryStage); // dialog.initStyle(StageStyle.EXTENDED); // uncomment for bug dialog.initModality(Modality.NONE); dialog.setResizable(true); // This is important dialog.getDialogPane().getButtonTypes().addAll(ButtonType.OK); dialog.setOnCloseRequest(dialogEvent -> { System.out.println("Close the dialog pane. This is not called when EXTENDED is used."); }); dialog.show(); }); StackPane root = new StackPane(button); Scene scene = new Scene(root, 300, 200); primaryStage.setScene(scene); primaryStage.show(); } public static void main(String[] args) { launch(args); } } ------------- PR Comment: https://git.openjdk.org/jfx/pull/1831#issuecomment-2978574395