<AWT Dev> [8] RFR: JDK-8012026 [macosx] Component.getMousePosition() does not work in an applet on MacOS

Anthony Petrov anthony.petrov at oracle.com
Tue Aug 27 03:22:13 PDT 2013

Hi Petr,

The fix looks good to me.

Note that AWT is a multi-threaded GUI toolkit, and since you don't use 
Swing APIs in your fix, you could eliminate all the 
invokeLater/invokeAndWait() calls from the tests to simplify them. But I 
don't insist on this. They should work fine as they are, too.

best regards,

On 08/26/2013 07:08 PM, Petr Pchelko wrote:
> Hello, AWT Team.
> Please review the fix for the following issue:
> http://bugs.sun.com/view_bug.do?bug_id=8012026
> The fix is available at:
> http://cr.openjdk.java.net/~pchelko/8012026/webrev.00/
> MoiseInfoPeer.isWindowUnderMouse was implemented via the native peer method. This was a workaround for another issue:
> if a new frame Popups under the mouse we did not get MouseEntered/Exited events for it. However, this issue was already resolved,
> so the workaround is not needed any more.  The only problem was with inactive applications: we did not  get MouseEntered/Exited
> for them, but this was also wrong, because on Windows and Linux we get mouse events for inactive apps. So, after the issue
> with inactive apps was resolved (see AWTView.m) the workaround could be safely removed.
> This fix resolves a number of bugs I've found for normal frames: the Component.getMousePosition did not pay attention to overlay windows
> and so did not conform to the javadoc. And Component.getMousePosition works for applets now. There is a minor problem with applets though:
> it reports null if the browser window is inactive. However, this is a limitation in NPAPI, so no workaround could be created.
> Tested on Mac in Applet mode, with SWT_AWT bridge and for normal windows.
> With best regards. Petr.

More information about the awt-dev mailing list