Re: 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) [v5]

2021-06-17 Thread Phil Race
On Thu, 17 Jun 2021 20:49:59 GMT, Alexander Zvegintsev  
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.
>
> Alexander Zvegintsev has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   @apiNote added, Suggests -> Requests

Marked as reviewed by prr (Reviewer).

-

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


Re: 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) [v4]

2021-06-17 Thread Alexander Zvegintsev
On Thu, 17 Jun 2021 20:31:07 GMT, Phil Race  wrote:

>> Alexander Zvegintsev has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   header fix
>
> src/java.desktop/share/classes/java/awt/Taskbar.java line 341:
> 
>> 339: /**
>> 340:  * Obtains an image of this application's icon.
>> 341:  * 
> 
> As discussed off-line, preface this with "@apiNote"

updated

-

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


Re: 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) [v5]

2021-06-17 Thread Alexander Zvegintsev
> 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.

Alexander Zvegintsev has updated the pull request incrementally with one 
additional commit since the last revision:

  @apiNote added, Suggests -> Requests

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3250/files
  - new: https://git.openjdk.java.net/jdk/pull/3250/files/312abff4..4e5273e5

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=3250=04
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=3250=03-04

  Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3250.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3250/head:pull/3250

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


Re: 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) [v4]

2021-06-17 Thread Phil Race
On Thu, 17 Jun 2021 17:33:48 GMT, Alexander Zvegintsev  
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.
>
> Alexander Zvegintsev has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   header fix

src/java.desktop/share/classes/java/awt/Taskbar.java line 325:

> 323: 
> 324: /**
> 325:  * Suggests the system to change this application's icon to the 
> provided {@code image}.

Suggests -> Requests

src/java.desktop/share/classes/java/awt/Taskbar.java line 341:

> 339: /**
> 340:  * Obtains an image of this application's icon.
> 341:  * 

As discussed off-line, preface this with "@apiNote"

-

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


Re: 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) [v4]

2021-06-17 Thread Alexander Zvegintsev
> 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.

Alexander Zvegintsev has updated the pull request incrementally with one 
additional commit since the last revision:

  header fix

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3250/files
  - new: https://git.openjdk.java.net/jdk/pull/3250/files/b5432e78..312abff4

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=3250=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=3250=02-03

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3250.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3250/head:pull/3250

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


Re: 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) [v3]

2021-06-17 Thread Alexander Zvegintsev
> 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.

Alexander Zvegintsev has updated the pull request incrementally with one 
additional commit since the last revision:

  update

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3250/files
  - new: https://git.openjdk.java.net/jdk/pull/3250/files/a265fc99..b5432e78

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=3250=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=3250=01-02

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3250.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3250/head:pull/3250

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


Re: 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) [v2]

2021-05-27 Thread Alexander Zvegintsev
On Wed, 26 May 2021 17:51:55 GMT, Alexander Zvegintsev  
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.
>
> Alexander Zvegintsev has updated the pull request with a new target base due 
> to a merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains three additional 
> commits since the last revision:
> 
>  - update
>  - Merge branch 'openjdk:master' into Taskbar_getIconImageSpec_8264125
>  - initial

@mrserb @dbessono please review

-

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


Re: 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) [v2]

2021-05-26 Thread Alexander Zvegintsev
> 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.

Alexander Zvegintsev has updated the pull request with a new target base due to 
a merge or a rebase. The incremental webrev excludes the unrelated changes 
brought in by the merge/rebase. The pull request contains three additional 
commits since the last revision:

 - update
 - Merge branch 'openjdk:master' into Taskbar_getIconImageSpec_8264125
 - initial

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3250/files
  - new: https://git.openjdk.java.net/jdk/pull/3250/files/74bccd43..a265fc99

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=3250=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=3250=00-01

  Stats: 695093 lines in 8625 files changed: 120831 ins; 548167 del; 26095 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3250.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3250/head:pull/3250

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


Re: 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)

2021-05-08 Thread Alexander Zvegintsev
On Fri, 7 May 2021 19:57:02 GMT, Phil Race  wrote:

> Leaving aside specification. what does an app really want this to return ?
> Should we start from there ?

We are returning current dock icon image from system.

> 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 ?

It might be a good solution, but I see some difficulties here.
If we just save passed image instance, its content might be modified by user 
between `setIconImage()` and `getIconImage()` calls.

`setIconImage()` internally converts passed image, so it does not follow its 
changes.
Thus we will get a discrepancy between result from `getIconImage()` and actual 
dock icon image on macOS side.
(Probably we can mitigate this by modifying the javadoc with some vague wording 
though.)

Ideally we should make a copy of an icon passed to `setIconImage()` method to 
prevent modification of its content.
`setIconImage()`/`getIconImage()` works with too wide type `java.awt.Image`, 
and I am not aware of any reliable way to clone every possible subtype of it.

-

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


Re: 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)

2021-05-07 Thread Phil Race
On Mon, 29 Mar 2021 18:57:55 GMT, Alexander Zvegintsev  
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


Re: 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)

2021-04-30 Thread Alexander Zvegintsev
On Mon, 29 Mar 2021 18:57:55 GMT, Alexander Zvegintsev  
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.

CSR added.

-

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


Re: 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)

2021-03-30 Thread Alexander Zuev
On Mon, 29 Mar 2021 18:57:55 GMT, Alexander Zvegintsev  
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.

Marked as reviewed by kizune (Reviewer).

-

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