Hi All,

Kindly review the fix for JDK9.

Bug: 
https://bugs.openjdk.java.net/browse/JDK-8147841 
<https://bugs.openjdk.java.net/browse/JDK-8147841>

Webrev: 
http://cr.openjdk.java.net/~arapte/manajit/8147841/webrev.00/ 
<http://cr.openjdk.java.net/~arapte/manajit/8147841/webrev.00/>

Issue: 
        [macosx] Updating TrayIcons popup menu does not work on Mac OS X.

Cause: 
        Wrong address of Popup menu was referred by native code (Mac OS). The 
native side was always referring to the popup menu created initially and the 
popup menu created later was not referred by the native code. Popup menu was 
getting updated internally (in java code), the new popup menu was not getting 
accessed/used by the native code (mac os x).  

Explanation with code points as below:

File CTrayIcon.m:
        On mouseDown event java method getPopupMenuModel was called using 
JNFCallLongMethod. getPopupMenuModel on the java side was always returning the 
address of the popup menu created initially and because of this updated popup 
menus was not getting shown on clicking the Tray icon.

Fix: 
        In method getPopupMenuModel the address of the new popup menu is 
updated in case there is a new popup menu. If the new popup points to null then 
0 is returned as address. And in cases the new popup and the initial popup menu 
are same then the initial popup menu's address is returned.


Regards,
Manajit

Reply via email to