On Thu, 12 May 2022 18:59:47 GMT, Alexey Ivanov <aiva...@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.

@aivanov-jdk Thank you for looking into this issue and suggesting a better & 
optimized approach. 
Additionally adding you as a contributor for this PR.

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

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

Reply via email to