Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8251241

macOS: iconify property doesn't change after minimize when resizable is false

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • jfx11, 8u191, jfx14
    • jfx16
    • javafx
    • None
    •  

       

       

       

    Backports

      Description

        The iconized property behaves weirdly when resizable is false.
        The property doesn't change when the os minimize button is called.
        The property also resets to false (without deminimizing) when iconized is set to true when resizable is false. (workaround is to temporarily change resizable to true).

        ```
        public class JavaFXBugIconified extends Application {
            @Override
            public void start(Stage primaryStage) throws Exception {

                VBox pin = new VBox();
                Button button = new Button("iconified");

                pin.setPrefWidth( 600);
                pin.getChildren().add(button);
                pin.getChildren().add(new ToggleButton());

                primaryStage.setResizable(false);
                primaryStage.setScene(new Scene(pin));

                primaryStage.show();


                // Not important for the bug, but useful for testing
                button.onActionProperty().set((e) -> {
                    primaryStage.setResizable(true);
                    primaryStage.setIconified(true);
                    new Thread(() -> {
                        try {
                            System.out.println("ASDF");
                            Thread.sleep(2000);
                            Platform.runLater(() -> {
                                primaryStage.setIconified(false);
                                primaryStage.setResizable(false);
                            });
                        } catch (Throwable ee) {
                            ee.printStackTrace();
                        }
                    }).start();
                });
            }
        }
        ```

        Attachments

          Issue Links

            Activity

              People

                fkirmaier Florian Kirmaier
                fkirmaier Florian Kirmaier
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: