[jfx15] RFR: 8248490: [macOS] Undecorated stage does not minimize

Ambarish Rapte arapte at openjdk.java.net
Wed Jul 15 11:04:02 UTC 2020

On Fri, 10 Jul 2020 18:23:58 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

> When running a JavaFX application on macOS using a JDK compiled with the MacOSX 10.13 SDK or later, an undecorated or
> transparent stage cannot be programmatically minimized (iconified). The reason for this failure is that JavaFX only
> sets the `NSMiniaturizableWindowMask` bit in the `styleMask` of the `NSWindow` for decorated windows. Previous versions
> of the MacOSX SDK would minimize and restore a windows regardless of the setting of this flag. When the application is
> compiled against a newer SDK, Apple honors that flag and prevents the window from being minimized.  Note that it is the
> version of the SDK used to compile the JDK and not the version that is used to compile JavaFX that exposes this bug.
> The fix is to temporarily set the `NSMiniaturizableWindowMask` prior to calling `miniaturize` or `deminiaturize`, and
> restore it afterwards. This seems safer than setting the bit unconditionally when the NSWindow is created, which would
> have been another approach.  A similar fix was done for AWT. See
> [JDK-8214046](https://bugs.openjdk.java.net/browse/JDK-8214046).  I propose to fix this in JavaFX 15, so it it targeted
> to the `jfx15` branch.

Fix and test both look good to me. Confirmed that test fails before and passes after the fix.
At current stage of jfx15, approach of safe fix seems preferable over always setting the the style.
Just a small query, will we fix this differently in main line ?


Marked as reviewed by arapte (Reviewer).

PR: https://git.openjdk.java.net/jfx/pull/264

More information about the openjfx-dev mailing list