Skip to content

Conversation

mstr2
Copy link
Collaborator

@mstr2 mstr2 commented Sep 10, 2025

  1. Replace undocumented AppleColorPreferencesChangedNotification with NSSystemColorsDidChangeNotification.
  2. Replace undocumented AppleInterfaceThemeChangedNotification with a KVO registration for NSApp.effectiveAppearance.

This fix can be tested using either PlatformPreferencesChangedTest, or Monkey Tester > Tools > Platform preferences monitor.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8367370: Accent color platform preference not updating in macOS 26 (Tahoe) (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1895/head:pull/1895
$ git checkout pull/1895

Update a local copy of the PR:
$ git checkout pull/1895
$ git pull https://git.openjdk.org/jfx.git pull/1895/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1895

View PR using the GUI difftool:
$ git pr show -t 1895

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1895.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 10, 2025

👋 Welcome back mstrauss! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Sep 10, 2025

@mstr2 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:

8367370: Accent color platform preference not updating in macOS 26 (Tahoe)

Reviewed-by: mfox, kcr

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 19 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

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

@openjdk openjdk bot added the rfr Ready for review label Sep 10, 2025
@mlbridge
Copy link

mlbridge bot commented Sep 10, 2025

Webrevs

@beldenfox
Copy link
Contributor

I was able to test this on macOS 13, 15, and 26 RC. I only focused on changes to the dark/light appearance, accent color, and highlight color. All versions of the OS behaved identically and updated the platform preferences reliably.

Under the hood I can see that updatePreferences can be called up to three times when the accent color changes. In most cases this leads to just a single set of changes being broadcast on the Java side. The exception is when I change the accent color to or from "graphite". When changing from "multicolor" to "graphite" I see three sets of changes each touching a different set of preferences with the exception of macOS.NSColor.keyboardFocusIndicatorColor which is changed twice, once in the second set of changes and again in the third. When changing from "graphite" to "multicolor" I see two sets of changes and macOS.NSColor.keyboardFocusIndicatorColor is altered in both of them.

I don't consider these bugs but this is a change from the old behavior. "Graphite" is a special accent color which also affects things like the stoplight controls in the title bar which go grayscale.

@mstr2
Copy link
Collaborator Author

mstr2 commented Sep 13, 2025

That's probably because the one-second delay to pick up the accent color is no longer necessary with the correct notification APIs. In general, we don't specify how preference change notifications are delivered. I've previously proposed change aggregation on the Java side, because multiple notifications are also a thing on Windows.

@kevinrushforth kevinrushforth self-requested a review September 15, 2025 15:07
@kevinrushforth
Copy link
Member

/reviewers 2

@openjdk
Copy link

openjdk bot commented Sep 15, 2025

@kevinrushforth
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

Copy link
Contributor

@beldenfox beldenfox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look fine to me and are working on macOS 13, 15, and 26.

Copy link
Member

@kevinrushforth kevinrushforth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me. I tested on macOS 14 (no change in behavior) and 26 (notification now works where it didn't before).

@openjdk openjdk bot added the ready Ready to be integrated label Sep 22, 2025
@mstr2
Copy link
Collaborator Author

mstr2 commented Sep 22, 2025

/integrate

@mstr2
Copy link
Collaborator Author

mstr2 commented Sep 22, 2025

I think this fix should be backported to jfx25u.

@openjdk
Copy link

openjdk bot commented Sep 22, 2025

Going to push as commit 7a4ec27.
Since your change was applied there have been 19 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 22, 2025
@openjdk openjdk bot closed this Sep 22, 2025
@openjdk openjdk bot removed ready Ready to be integrated rfr Ready for review labels Sep 22, 2025
@openjdk
Copy link

openjdk bot commented Sep 22, 2025

@mstr2 Pushed as commit 7a4ec27.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@mstr2
Copy link
Collaborator Author

mstr2 commented Sep 22, 2025

/backport jfx25u

@openjdk
Copy link

openjdk bot commented Sep 22, 2025

@mstr2 the backport was successfully created on the branch backport-mstr2-7a4ec274-master in my personal fork of openjdk/jfx25u. To create a pull request with this backport targeting openjdk/jfx25u:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 7a4ec274 from the openjdk/jfx repository.

The commit being backported was authored by Michael Strauß on 22 Sep 2025 and was reviewed by Martin Fox and Kevin Rushforth.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jfx25u:

$ git fetch https://github.com/openjdk-bots/jfx25u.git backport-mstr2-7a4ec274-master:backport-mstr2-7a4ec274-master
$ git checkout backport-mstr2-7a4ec274-master
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jfx25u.git backport-mstr2-7a4ec274-master

⚠️ @mstr2 You are not yet a collaborator in my fork openjdk-bots/jfx25u. An invite will be sent out and you need to accept it before you can proceed.

@mstr2 mstr2 deleted the fixes/system-colors-notification branch September 22, 2025 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants