RFR: JDK-8255439: System Tray icons get corrupted when windows scaling changes [v5]

Harshitha Onkar duke at openjdk.java.net
Fri May 13 01:01:49 UTC 2022


On Thu, 12 May 2022 18:59:47 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   trayicon update triggered on taskbar reload
>
> Yeah, this version works correctly on both test systems that I have.
> 
> I think the solution could be simplified. First of all, there's no need to call `UpdateTrayIconHandler` if DPI hasn't changed. A handler for `WM_DPICHANGED` sets a flag; then `WmTaskbarCreated` uses the flag to call updateImage.
> 
> `WmTaskbarCreated` iterates over all the icons, you can use this loop to call `WTrayIconPeer.updateImage`. This way all the icons will be updated on the toolkit thread. I'm not sure whether the handler should still sent both `NIM_MODIFY` and `NIM_ADD`; the former should be enough for DPI change (called from `updateNativeImage`), and the latter should be enough for the case where the Taskbar is really recreated.

Based on @aivanov-jdk suggestions, new code changes have been incorporated. With the new change - tray icon update is triggered only when DPI change event is received and in WmTaskbarCreated().

Changes have been tested on Win 10 & 11 and works as expected.

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

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



More information about the client-libs-dev mailing list