RFR: JDK-8255439: System Tray icons get corrupted when windows scaling changes [v8]

Harshitha Onkar duke at openjdk.java.net
Fri May 13 22:30:49 UTC 2022


On Fri, 13 May 2022 22:04:39 GMT, Phil Race <prr at openjdk.org> wrote:

>> Harshitha Onkar 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 11 additional commits since the last revision:
>> 
>>  - Merge branch 'master' into WinTrayIcon
>>  - reverted SystemTray changes
>>  - new changes - trayicon update triggered in WmTaskbarCreated
>>  - trayicon update triggered on taskbar reload
>>  - test case exit issue fix
>>  - formatting changes
>>  - resized instruction window and formatted line lengths
>>  - removed whitespaces error due to CRLF
>>  - removed whitespace error
>>  - added manual to test case
>>  - ... and 1 more: https://git.openjdk.java.net/jdk/compare/f004848d...60391f28
>
> src/java.desktop/windows/native/libawt/windows/awt_TrayIcon.cpp line 239:
> 
>> 237:         env->ExceptionDescribe();
>> 238:         env->ExceptionClear();
>> 239:     }
> 
> Reduce this to ExceptionClear()
> (1) ExceptionDescribe() per the docs https://docs.oracle.com/en/java/javase/17/docs/specs/jni/functions.html#exceptions
> prints a message .. which we don't want .. it is meant for debugging not production and FWIW it clears the pending exception so any time you see Describe() followed by Clear() the code seems odd (well pointless)
> 2) safe_ExceptionOccurred is only useful if you are coming from a JNI method that uses C++ exception handling. Here the call originates from native doesn't it ? And we don't return to Java since it is a native event loop.
> 
> Ah I see we also have it called from _initIDs. Well I think for simplicity my advice stands.
> 
> So JUST env->ExceptionClear() will do

@prrace Thanks for the details on ExceptionClear and its usage. Makes sense. I'll have it fixed on my next commit.

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

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



More information about the client-libs-dev mailing list