RFR: 8286872: Refactor add/modify notification icon (TrayIcon) [v2]
Alexey Ivanov
aivanov at openjdk.java.net
Wed May 18 12:22:43 UTC 2022
> 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.
Alexey Ivanov has updated the pull request incrementally with one additional commit since the last revision:
8286872: Replace SendTrayMessage(NIM_MODIFY) with ModifyTrayIcon()
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/8749/files
- new: https://git.openjdk.java.net/jdk/pull/8749/files/2e85731c..67625852
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=8749&range=01
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=8749&range=00-01
Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
Patch: https://git.openjdk.java.net/jdk/pull/8749.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/8749/head:pull/8749
PR: https://git.openjdk.java.net/jdk/pull/8749
More information about the client-libs-dev
mailing list