JDK-8305645 : System Tray icons get corrupted when Windows primary monitor changes
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 11.0.18,15,17.0.6,20,21
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_10
  • CPU: x86_64
  • Submitted: 2023-04-05
  • Updated: 2024-04-09
  • Resolved: 2023-06-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 17 JDK 21 JDK 22
11.0.24-oracleFixed 17.0.12-oracleFixed 21.0.4-oracleFixed 22 b02Fixed
Related Reports
Relates :  
Relates :  
Description
This is a variation of bug JDK-8255439 

Changing the display scale would blur the system tray icon as described in the above bug.  This has been fixed, however the same issue is still seen when you change the primary monitor to another monitor using a different display scale.

STEPS
In Windows have two monitors using different display scales (e.g. 100% and 125%)
One of these monitors will be the primary monitor and contain the system tray icons
Via Display settings, select the monitor that isn't the primary and click "Make this my main display"
The system tray icons switch to the other monitor

BUG
Icons blur


Comments
[jdk11u-fix-request] Approval Request from Amos "Backporting for parity with 11.0.24-oracle. Clean backport. SAP nightlies passed on 2024-03-13,14,15”
15-03-2024

[jdk17u-fix-request] Approval Request from Amos "Backporting for parity with 17.0.12-oracle. Clean backport. SAP nightlies passed on 2024-03-10,14”
15-03-2024

[jdk21u-fix-request] Approval Request from Amos "Backporting for parity with 21.0.4-oracle. Clean backport. SAP nightlies passed on 2024-03-10,12,13”
15-03-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk11u-dev/pull/2589 Date: 2024-03-08 18:26:42 +0000
08-03-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk21u-dev/pull/343 Date: 2024-03-08 18:26:25 +0000
08-03-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/2278 Date: 2024-03-08 18:26:35 +0000
08-03-2024

Changeset: 6cd370e0 Author: Harshitha Onkar <honkar@openjdk.org> Date: 2023-06-09 16:11:46 +0000 URL: https://git.openjdk.org/jdk/commit/6cd370e04b01c3033eb439de0f38e9b6d703c6f4
09-06-2023

When primary monitor is changed, windows sends WM_DISPLAYCHANGE message. Triggering the tray icon add when taskbar is re-added to the new primary monitor looks to be a potential solution and fixes the tray icon distortion.
07-06-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/14368 Date: 2023-06-07 19:05:56 +0000
07-06-2023

[~vdyakov] Yes, it is replicable on 21. The case under which it is replicable is slightly different from the original fix. Needs to be investigated further.
12-04-2023

does it affect mainline (21)?
12-04-2023

Reproduced in 17.0.6 as well (and updated the Affects Version accordingly). Laptop monitor at 150% with external monitor at 100%. Laptop is initially the primary monitor. Change primary monitor to the external display and the system tray icon moves from the 150% monitor to the 100% monitor and gets corrupted.
12-04-2023

We upgraded to use 17.0.5 to pick up that bug fix, and with that version confirmed that the display scale issue was addressed for us. However perhaps we are using 17.0.5-oracle as I notice that this version includes the backport in it as well. I will double check with 17.0.6 as well though to be sure.
05-04-2023

JDK-8296859 back ported to 17.0.6 please verify (as your Affects version in this report is 17.0.5)
05-04-2023