[jfx15] RFR: 8248490: [macOS] Undecorated stage does not minimize
aghaisas at openjdk.java.net
Wed Jul 15 11:42:53 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.
Marked as reviewed by aghaisas (Reviewer).
More information about the openjfx-dev