Follow up to "8313698: BaseMultiResolutionImage doesn't work as icon of java.awt.Window on Linux"

Aleksei Ivanov alexey.ivanov at oracle.com
Tue Aug 8 20:04:02 UTC 2023


Hello Andrei,

You may want to update your test case so that it generates icons on the 
fly and uses numbers to easily distinguish one from another. You can get 
code from WindowIconUpdateOnDPIChangingTest.java [1].

You can read the commends in PR #6180 [2] where the test was added. 
During the code review, it was determined the fix wasn't applicable to 
Linux and macOS, so only Windows-specific changes remain.

As far as I know, Ubuntu doesn't show icons in the title bar of a 
window, there's an app icon on the dock only, similar to macOS.

Javadoc for Window.setIconImages [3] mentions, “the icons list can 
contain MultiResolutionImage images”.

Disclaimer: I didn't run the test case.

-- 
Regards,
Alexey

[1] 
https://github.com/openjdk/jdk/blob/6864441163f946d0bec7380a2a120e31b812a6dc/test/jdk/java/awt/Window/WindowIconUpdateOnDPIChanging/WindowIconUpdateOnDPIChangingTest.java
[2] https://github.com/openjdk/jdk/pull/6180
[3] 
https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/java/awt/Window.html#setIconImages(java.util.List)

On 08/08/2023 19:40, Andrei Rybak wrote:
> Hello,
>
> I've reported https://bugs.openjdk.org/browse/JDK-8313698 and, unfortunately,
> there's some confusion in the ticket due to my poor choice of words for
> describing the _default_ icon of the JFrame.  The default icon depends on the
> vendor of the JDK, and it isn't the Duke icon for all of them.  As can be seen
> from file "Capture_Windows.PNG" in the Jira issue, it can also be the coffee
> cup Java logo.
>
> Because the person who reproduced the bug (Praveen Narayanaswamy) used
> two images of Duke for files icon32x32.png and icon64x64.png [1] as input for
> the _custom_ icon with BaseMultiResolutionImage, it gets really confusing.
> My reproducer, available on GitHub, just uses two images of the numbers "32"
> and "64" [2] for clarity. I have updated the wording in the reproducer on GitHub
> to stop mentioning the Duke icon.[3]
>
> I hope this clarifies the ticket description.
>
> [1] The images in the Jira issue right now are not of the resolution claimed
>       in the filenames, but the resolution doesn't matter for the bug's
> reproducibility.
> [2] https://github.com/rybak/foobar/blob/master/baz/src/main/resources/swing/icon32x32.png
>       and
>       https://github.com/rybak/foobar/blob/master/baz/src/main/resources/swing/icon64x64.png
>       with honest resolutions, just to be as close as possible for the
> actual use-case.
> [3] up-to-date reproducer on the branch master:
>       https://github.com/rybak/foobar/blob/master/baz/src/main/java/swing/MultiResolutionImageBug.java




More information about the client-libs-dev mailing list