RFR: 8357004: Windows platform color changes are not picked up in some cases

Michael Strauß mstrauss at openjdk.org
Wed May 14 23:05:35 UTC 2025


The platform preferences API does not pick up the correct `UIColor` values when changing from a high-contrast Windows theme to another high-contrast theme.

The reason is that the implementation incorrectly assumes that changing the high-contrast theme does not affect the `UIColor` values. The fix is simple: when we query the `SysColor` values, we also need to query the `UIColor` values.

To reproduce: open platform preferences monitor in MonkeyTester (Tools -> Platform Preferences Monitor). Then switch between different high-contrast themes in Windows Settings and observe the `Windows.UIColor.*` values.

This fix can only be tested manually, since it requires interacting with the Windows OS in non-automatable ways.

-------------

Commit messages:
 - fix: changed UIColors are not picked up in some cases

Changes: https://git.openjdk.org/jfx/pull/1806/files
  Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=1806&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8357004
  Stats: 5 lines in 2 files changed: 4 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jfx/pull/1806.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/1806/head:pull/1806

PR: https://git.openjdk.org/jfx/pull/1806


More information about the openjfx-dev mailing list