Skip to content

Conversation

@aivanov-jdk
Copy link
Member

@aivanov-jdk aivanov-jdk commented May 17, 2022

Encapsulate the logic of adding or modifying a notification icon aka tray icon. This is to avoid code duplication between AwtTrayIcon::WmTaskbarCreated and AwtTrayIcon::_UpdateIcon.

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.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (1 review required, with at least 1 reviewer)

Issue

  • JDK-8286872: Refactor add/modify notification icon (TrayIcon)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/8749/head:pull/8749
$ git checkout pull/8749

Update a local copy of the PR:
$ git checkout pull/8749
$ git pull https://git.openjdk.java.net/jdk pull/8749/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8749

View PR using the GUI difftool:
$ git pr show -t 8749

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/8749.diff

@bridgekeeper
Copy link

bridgekeeper bot commented May 17, 2022

👋 Welcome back aivanov! A progress list of the required criteria for merging this PR into pr/8441 will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label May 17, 2022
@openjdk
Copy link

openjdk bot commented May 17, 2022

@aivanov-jdk The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label May 17, 2022
@mlbridge
Copy link

mlbridge bot commented May 17, 2022

Webrevs

@aivanov-jdk
Copy link
Member Author

I replaced the calls to SendTrayMessage(NIM_MODIFY) with ModifyTrayIcon() for consistency and changed both AddTrayIcon() and ModifyTrayIcon() to inline methods which should remove an overhead of additional function call.

I also moved SendTrayMessage into private section of the class, it's used internally only.

@openjdk-notifier openjdk-notifier bot changed the base branch from pr/8441 to master May 18, 2022 19:49
@openjdk-notifier
Copy link

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

@openjdk
Copy link

openjdk bot commented May 18, 2022

@aivanov-jdk this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands 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
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label May 18, 2022
@openjdk
Copy link

openjdk bot commented May 19, 2022

@aivanov-jdk This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8286872: Refactor add/modify notification icon (TrayIcon)

Reviewed-by: azvegint, kizune, honkar

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 12 new commits pushed to the master branch:

  • e60d8b5: 8253176: Signature.getParameters should specify that it can throw UnsupportedOperationException
  • aa50625: 8286447: [Linux] AWT should start in Headless mode if headful AWT library not installed
  • 655500a: 8286654: Add an optional description accessor on ToolProvider interface
  • ac6a7d7: 8278367: JNI critical region violation in CTextPipe.m:363
  • 83cec4b: 8284273: Early crashes in os::print_context on AArch64
  • fd36f37: 8286797: Guards of constant value false are not permitted
  • fa1b56e: 8280696: C2 compilation hits assert(is_dominator(c, n_ctrl)) failed
  • af7cda5: 8285733: [s390] Vector Instruction Emitters for element-wise access are broken
  • d24c84e: 8286873: Improve websocket test execution time
  • db19dc6: 8284688: Minor cleanup could be done in java.security.jgss
  • ... and 2 more: https://git.openjdk.java.net/jdk/compare/fc3edf2412461f41ac4dfd8b047257432620ba6d...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed merge-conflict Pull request has merge conflict with target branch labels May 19, 2022
Copy link
Member

@azvegint azvegint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still looks good.

@honkar-jdk
Copy link
Contributor

Changes tested on Win10 and works well.

@openjdk
Copy link

openjdk bot commented May 19, 2022

@honkar-jdk Unknown command approve - for a list of valid commands use /help.

@aivanov-jdk
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented May 19, 2022

Going to push as commit 9f562ef.
Since your change was applied there have been 15 commits pushed to the master branch:

  • b089229: 8271078: jdk/incubator/vector/Float128VectorTests.java failed a subtest
  • 079312c: 8286182: [BACKOUT] x86: Handle integral division overflow during parsing
  • 7b19226: 8267038: Update IANA Language Subtag Registry to Version 2022-03-02
  • e60d8b5: 8253176: Signature.getParameters should specify that it can throw UnsupportedOperationException
  • aa50625: 8286447: [Linux] AWT should start in Headless mode if headful AWT library not installed
  • 655500a: 8286654: Add an optional description accessor on ToolProvider interface
  • ac6a7d7: 8278367: JNI critical region violation in CTextPipe.m:363
  • 83cec4b: 8284273: Early crashes in os::print_context on AArch64
  • fd36f37: 8286797: Guards of constant value false are not permitted
  • fa1b56e: 8280696: C2 compilation hits assert(is_dominator(c, n_ctrl)) failed
  • ... and 5 more: https://git.openjdk.java.net/jdk/compare/fc3edf2412461f41ac4dfd8b047257432620ba6d...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label May 19, 2022
@openjdk openjdk bot closed this May 19, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels May 19, 2022
@openjdk
Copy link

openjdk bot commented May 19, 2022

@aivanov-jdk Pushed as commit 9f562ef.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@aivanov-jdk aivanov-jdk deleted the 8286872-addModifyTrayIcon branch May 20, 2022 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client client-libs-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants