JDK-8251241 : macOS: iconify property doesn't change after minimize when resizable is false
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: 8u191,openjfx11,openjfx14
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • Submitted: 2020-08-06
  • Updated: 2020-11-24
  • Resolved: 2020-08-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 Other
8u281Fixed openjfx11.0.10Fixed
Related Reports
Duplicate :  
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();
        });
    }
}
```
Comments
Changeset: 85821ca1 Author: Florian Kirmaier <fkirmaier@openjdk.org> Committer: Kevin Rushforth <kcr@openjdk.org> Date: 2020-08-19 17:34:48 +0000 URL: https://git.openjdk.java.net/jfx/commit/85821ca1
19-08-2020

I can reproduce this. There are other iconify bugs on macOS, such as JDK-8249202.
13-08-2020

I confirmed that this also fixes JDK-8249202, so I will close that bug as a duplicate.
13-08-2020

I attached three test programs. I added a listener on the iconified property to make it easier to see the problem: 1. JavaFXBugIconified.java -- original program 2. JavaFXBugIconified2.java -- modified to comment out the workaround of temporarily enabling resize 3. JavaFXBugIconified3.java -- modified to use a resizable stage (as a baseline)
13-08-2020