Integrated: 8286872: Refactor add/modify notification icon (TrayIcon)
Alexey Ivanov
aivanov at openjdk.java.net
Thu May 19 20:08:42 UTC 2022
On Tue, 17 May 2022 13:02:49 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
> Encapsulate the logic of adding or modifying a notification icon aka tray icon. This is to avoid code duplication between [`AwtTrayIcon::WmTaskbarCreated`](https://github.com/openjdk/jdk/blob/7b988b31c661c6e3e58cf8ced81732e40a79d4f5/src/java.desktop/windows/native/libawt/windows/awt_TrayIcon.cpp#L477) and [`AwtTrayIcon::_UpdateIcon`](https://github.com/openjdk/jdk/blob/7b988b31c661c6e3e58cf8ced81732e40a79d4f5/src/java.desktop/windows/native/libawt/windows/awt_TrayIcon.cpp#L796).
>
> Separating adding and modifying the icon simplifies the methods, the actions are clearer: adding the icon requires sending `NIM_SETVERSION` message whereas modifying the icon doesn't.
>
> To verify the code works as before, I used `TrayIconScalingTest.java`. I killed explorer.exe process to verify the notification icon gets added. Changing DPI of the main display updates the displayed icon as expected.
This pull request has now been integrated.
Changeset: 9f562ef7
Author: Alexey Ivanov <aivanov at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/9f562ef7546c80e6ddce7b932f3f5ca17c741d21
Stats: 26 lines in 2 files changed: 14 ins; 5 del; 7 mod
8286872: Refactor add/modify notification icon (TrayIcon)
Reviewed-by: azvegint, kizune, honkar
-------------
PR: https://git.openjdk.java.net/jdk/pull/8749
More information about the client-libs-dev
mailing list