RFR: 8282526: Default icon is not painted properly [v6]
Alexey Ivanov
aivanov at openjdk.org
Fri Jul 8 15:05:40 UTC 2022
On Tue, 21 Jun 2022 03:04:29 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
> Before the JDK-8182043 we also used the MRI so it should be changed if the scale was changed from low to hidpi. It adds more variants which could be used by some other DPI, I think one important new variant is the 64x64 because it used as a large icon on HiDPI monitor.
MRI was used only to accommodate for the fact that shell may return icon of higher resolution according the system settings.
https://github.com/openjdk/jdk/blob/978bed6c7ff64148474df3dd1ab3b3707005b8fa/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java#L1032-L1034
If the main monitor scale was set to 200% and 16×16 icon was requested, the system returned 32×32.
In no way it handled different scale settings.
> But if the dpi is 125% or 150% it will not work even if the user will [try to request](https://github.com/openjdk/jdk/pull/2875#discussion_r641078169) such image.
The current code by @azuev-java handles this situation because the icon returned will contain five variants for the range of 100%, 125%, 150%, 175%, 200%.
I don't clearly understand your concern here.
> Take a look to the description of 8182043, the user wanted to get some large Icon, now imaging he would like to get a 79x79 icon for some file, did we provide a way to do that? I assume we even do not try to request that size from the operation system so it actually cannot ignore our request?
No, we do not request 79×79 because such an icon never exists in Windows because Windows shell does not use such a size to display a file. Well, it may exist if a developer for some reason included it in the app resources but it would rather be an exceptional case.
So if a Java app developer wants 79×79 icon, it will be scaled down from 96×96 or 128×128.
-------------
PR: https://git.openjdk.org/jdk/pull/7805
More information about the client-libs-dev
mailing list