Hi Petr,

1. src/macosx/native/sun/osxapp/ThreadUtilities.h
I suggest to introduce a static (+) method in the ThreadUtilities class rather than a new global macro.

Also, while I agree with Sergey that eventually we should use it everywhere in AWT, I suggest to replace other occurrences of this code later, with a separate refactoring fix. Use the new method only for the code that you change/introduce with this fix.

BTW, in case wait==NO, we should force going through the JNFRunLoop even if we're running on the main thread.


2. LWWindowPeer.java, CPlatformWindow.java, and peerType
It looks like the CPlatformWindow doesn't even need to know the peerType. I think we can safely drop the peerType argument from CPlatformWindow constructor, and only store it in the LWWindowPeer itself. Should we need the value in the future, we can always ask the LWWindowPeer since CPW keeps a reference to the peer object.


3. src/macosx/classes/sun/lwawt/macosx/CMouseInfoPeer.java
I think we could avoid using the instancof and instead introduce a method in the PlatformWindow interface (like isUnderMouse()). The CPW and CVPEF would simply provide different implementations for this method.


4. CWrapper.m
You could use the new ThreadingUtilities machinery here as well.

--
best regards,
Anthony

On 11/27/2012 1:55 PM, Petr Pchelko wrote:
Hello, AWT team.

please, review the following fix for 7154778:

http://cr.openjdk.java.net/~art/pchelko/7154778/

The bug description and evaluation is available here:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7154778

To work with the new EmbeddedFrame implementation, existing code (e.g. SWT) needs to be modified to use sun.lwawt.macosx.CViewEmbeddedFrame class instead of Apple's apple.awt.CEmbeddedFrame. Here is the corresponding patch for SWT:

http://cr.openjdk.java.net/~art/pchelko/7154778/swt_patch.txt


Best, Petr Pchelko

Reply via email to