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

Petr Pchelko petr.pchelko at oracle.com
Tue Jul 8 10:19:00 UTC 2014


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.


More information about the awt-dev mailing list