<AWT Dev> [9] Review Request: 8035568 [macosx] Cursor management unification.

Mike Swingler swingler at apple.com
Tue Jul 8 23:38:21 UTC 2014

> On Jul 8, 2014, at 3:19 AM, Petr Pchelko <petr.pchelko at oracle.com> wrote:
> Hello, AWT Team.
> Please review the fix for the issue:
> https://bugs.openjdk.java.net/browse/JDK-8035568
> The fix is available at:
> http://cr.openjdk.java.net/~pchelko/9/8035568/webrev.00/
> We are using 2 different methods for getting a cursor position in Robot and in LWAWT. I've changed our implementation to use Carbon method.
> nativeGetCursorPosition is a very hot method and changing it's implementation makes it run 35 times faster. Also we will never deadlock on it any more.
> However, I needed to change the isWindowUnderMouse implementation. The problem's that LWWindowPeer.windowUnderCursor is updated on mouse events
> and generated mouse events, so sometimes it may be not updated when called from a component resize handler. Luckily we can test it using native code. 
> isWindowUnderMouse is not a hot method at all, in real apps it's called very rarely (never called after a couple of hours of real IDE usage) so it's not a problem that it
> runs slower now.
> I've run all cursor/mouse tests. A couple of tests failed because they didn't have proper synchronization and we are too fast for them now. I've fixed it and open-sourced the tests.
> With best regards. Petr.

Has this change been tested on Retina? I don't see any effort to convert in and out of the screen coordinate system.

Mike Swingler
Apple Inc.

More information about the awt-dev mailing list