-
Notifications
You must be signed in to change notification settings - Fork 458
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
8319669: [macos14] Running any JavaFX app prints Secure coding warning #1280
8319669: [macos14] Running any JavaFX app prints Secure coding warning #1280
Conversation
I will do some additional testing and then take this PR out of Draft mode, making it "rfr". /reviewers 2 |
👋 Welcome back kcr! A progress list of the required criteria for merging this PR into |
@kevinrushforth |
Reviewers: @prrace @honkar-jdk @azuev-java |
Webrevs
|
Notes to reviewers:
|
modules/javafx.graphics/src/main/native-glass/mac/GlassApplication.m
Outdated
Show resolved
Hide resolved
PR openjdk/jdk#16569 has been created. It's still in Draft, but should be "rfr" soon. |
I completed my testing of this patch in combination with the patch from PR jdk#16569. I tested all four cases: (patched / unpatched JDK) X (patched / unpatched FX) See this PR comment for details. |
Tested by applying JavaFX changes + corresponding JDK patch. Testing looks good on older macOS version and macOS 14.1 GA. All combinations of patched/unpatched JDK and patched/unpatched FX along with different combinations of env vars was tested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix looks good and works well with the corresponding JDK patch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it on both x86 and arm based macOS 14 works fine.
@kevinrushforth This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 3 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
/integrate |
Going to push as commit 986ec4f.
Your commit was automatically rebased without conflicts. |
@kevinrushforth Pushed as commit 986ec4f. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Fix JDK-8319669 as follows:
NSApplicationDelegate
methodapplicationSupportsSecureRestorableState
inGlassApplication
and returnYES
. This silences the warning that FX applications now get on macOS 14.NSApplicationFX
subclass ofNSApplication
with no additional functionality. This stops AWT from overwriting the NSApplicationDelegate (GlassApplication
) that JavaFX sets during toolkit initialization in the case where the AWT toolkit is used from a JavaFX Application (e.g., when using SwingNode or other Swing functionality), and is necessary in order to safely do the above. It also fixes other problems that can result from the delegate being overwritten.As noted in the bug report, this PR solves the following problems:
Eliminates the "Secure coding is not enabled for restorable state" warning on macOS 14
The assertion error reported in JDK-8318129
The FX application stops getting messages when the application is hidden, deactivated, reactivated, etc. We currently don't do anything with these messages once the application is running, but we might do so in the future.
Probably related to the above, we sometimes get an odd behavior when trying to hide an application on macOS 13 using the CMD-H key after the AWT Toolkit has been initialized. Instead of hiding the window, it pops up a finder window with a folder icon and a label that shows the version of Java.
If AWT and FX return a different answer from their delegate's
applicationSupportsSecureRestorableState
method, it will crash on macOS 13.x.This is the FX equivalent of JDK-8318854 in AWT.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1280/head:pull/1280
$ git checkout pull/1280
Update a local copy of the PR:
$ git checkout pull/1280
$ git pull https://git.openjdk.org/jfx.git pull/1280/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1280
View PR using the GUI difftool:
$ git pr show -t 1280
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1280.diff
Webrev
Link to Webrev Comment