<AWT Dev> RFR: 8264125: Specification of Taskbar::getIconImage doesn't mention that the returned image might not be equal to the Taskbar::setIconImage one. (eg on Mac OS)

Phil Race prr at openjdk.java.net
Fri May 7 20:03:26 UTC 2021


On Mon, 29 Mar 2021 18:57:55 GMT, Alexander Zvegintsev <azvegint at openjdk.org> wrote:

> This fix is to explicitly specify that `Taskbar::getIconImage` may return an object different from passed to `Taskbar::setIconImage`.
> 
> Actually it is always returns a different object on macOS(the only OS which supports this feature), but I want to save some options if we decide to rework this.

I've read (quickly) the comments in the bug. 
I am not settled on what I think is the right answer here, but the spec words in the PR "may not be equal" leave too many
doubts in the mind of a reader as to what not equal means

I can see there are words added in the bug report that haven't yet made it into the PR
"however it should contain at least one visually similar image."

Now we are getting into implicitly saying you might get back a MultiResolutionImage.

Visually similar could be open to interpretation if we have a MIR where the renderings are different as can reasonably happen when a higher resolution allows for a more realistic image .. 

Do we definitely not want to just hang on to whatever an application set so we can return it without modification ?
What are the problems with that ?
Leaving aside specification. what does an app really want this to return ?
Should we start from there ?

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

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


More information about the awt-dev mailing list