Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8248490: [macOS] Undecorated stage does not minimize #264

Conversation

@kevinrushforth
Copy link
Member

@kevinrushforth kevinrushforth commented Jul 10, 2020

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.

I propose to fix this in JavaFX 15, so it it targeted to the jfx15 branch.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8248490: [macOS] Undecorated stage does not minimize

Reviewers

  • Ambarish Rapte (arapte - Reviewer)
  • Ajit Ghaisas (aghaisas - Reviewer)

Download

$ git fetch https://git.openjdk.java.net/jfx pull/264/head:pull/264
$ git checkout pull/264

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jul 10, 2020

👋 Welcome back kcr! A progress list of the required criteria for merging this PR into jfx15 will be added to the body of your pull request.

@kevinrushforth kevinrushforth changed the title WIP: 8248490: [macOS] Undecorated stage does not minimize 8248490: [macOS] Undecorated stage does not minimize Jul 10, 2020
@openjdk openjdk bot added the rfr label Jul 10, 2020
@kevinrushforth
Copy link
Member Author

@kevinrushforth kevinrushforth commented Jul 10, 2020

/reviewers 2

@openjdk
Copy link

@openjdk openjdk bot commented Jul 10, 2020

@kevinrushforth
The number of required reviews for this PR is now set to 2 (with at least 1 of role reviewers).

@kevinrushforth
Copy link
Member Author

@kevinrushforth kevinrushforth commented Jul 10, 2020

On a related note, even after this fix, an undecorated window cannot be restored (deminiaturized) programmatically. This is not related and is not a regression. I filed JDK-8249202 to track this as a follow-up issue.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Jul 10, 2020

Webrevs

@arapte
arapte approved these changes Jul 15, 2020
Copy link
Member

@arapte arapte left a comment

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 ?

@openjdk
Copy link

@openjdk openjdk bot commented Jul 15, 2020

@kevinrushforth This change now passes all automated pre-integration checks. When the change also fulfills all project specific requirements, type /integrate in a new comment to proceed. After integration, the commit message will be:

8248490: [macOS] Undecorated stage does not minimize

Reviewed-by: arapte, aghaisas
  • If you would like to add a summary, use the /summary command.
  • To credit additional contributors, use the /contributor command.
  • To add additional solved issues, use the /issue command.

Since the source branch of this PR was last updated there have been 15 commits pushed to the jfx15 branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid automatic rebasing, please merge jfx15 into your branch, and then specify the current head hash when integrating, like this: /integrate 5de99bea31dd83713d8a3f582822761daff175a2.

➡️ To integrate this PR with the above commit message to the jfx15 branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Jul 15, 2020
@kevinrushforth
Copy link
Member Author

@kevinrushforth kevinrushforth commented Jul 15, 2020

Just a small query, will we fix this differently in main line ?

No, I wasn't planning to revisit this. At least not until looking at the (P4) follow-up issue, JDK-8249202.

@arapte
Copy link
Member

@arapte arapte commented Jul 15, 2020

At least not until looking at the (P4) follow-up issue, JDK-8249202.

Sounds good to me, we can address these together.

@kevinrushforth
Copy link
Member Author

@kevinrushforth kevinrushforth commented Jul 15, 2020

/integrate

@openjdk openjdk bot closed this Jul 15, 2020
@openjdk openjdk bot added integrated and removed ready rfr labels Jul 15, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Jul 15, 2020

@kevinrushforth The following commits have been pushed to jfx15 since your change was applied:

Your commit was automatically rebased without conflicts.

Pushed as commit 2f4666a.

@kevinrushforth kevinrushforth deleted the kevinrushforth:8248490-minimize-undecorated branch Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants