RFR: 8286872: Refactor add/modify notification icon (TrayIcon) [v3]

openjdk-notifier[bot] duke at openjdk.java.net
Wed May 18 19:53:49 UTC 2022


On Wed, 18 May 2022 17:54:30 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.
>
> Alexey Ivanov has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Inline AddTrayIcon and ModifyTrayIcon
>  - Make SendTrayMessage private - it's used internally only

The dependent pull request has now been integrated, and the target branch of this pull request has been updated. This means that changes from the dependent pull request can start to show up as belonging to this pull request, which may be confusing for reviewers. To remedy this situation, simply merge the latest changes from the new target branch into this pull request by running commands similar to these in the local repository for your personal fork:


git checkout 8286872-addModifyTrayIcon
git fetch https://git.openjdk.java.net/jdk master
git merge FETCH_HEAD
# if there are conflicts, follow the instructions given by git merge
git commit -m "Merge master"
git push

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

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



More information about the client-libs-dev mailing list