On Fri, 29 Apr 2022 00:36:15 GMT, Sergey Bylokhov <s...@openjdk.org> wrote:

> Did you have a chance to check why the WM_DPICHANGED does not work, any 
> specific cases? It is used by checking the scale change for windows in AWT, 
> and no issues were reported for that as far as I know.

When DPI gets changed, many events are generated one after the other. By 
setting delays at various places in code I  observed that, the timing of 
triggering tray icon update could have effects on how it is rendered. 

When DPI is changed, along with `WM_DPICHANGED` msg the tray icon window's 
procedure receives `WMPOSCHANGING` and if we trigger a tray icon update before 
this, the icon gets distorted. I believe the cause for distortion might be - 
adding an icon to the system tray while it is still changing its size and 
position (WMPOSCHANGING) due to DPI changes. 

By triggering the update after `WMPOSCHANGING`, the tray icon gets added when 
all the updates to the System Tray are completed.

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

PR: https://git.openjdk.java.net/jdk/pull/8441

Reply via email to