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

Petr Pchelko petr.pchelko at oracle.com
Mon Aug 26 08:08:06 PDT 2013

Hello, AWT Team.

Please review the fix for the following issue:
The fix is available at:

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