diff --git a/src/macosx/native/sun/awt/AWTWindow.m b/src/macosx/native/sun/awt/AWTWindow.m index 687fa6b4d01b5683a23c4441bd83e225c4bb0e14..dcda6c3f9a828759a139faf7afe1e0a01c5e358a 100644 --- a/src/macosx/native/sun/awt/AWTWindow.m +++ b/src/macosx/native/sun/awt/AWTWindow.m @@ -468,8 +468,6 @@ AWT_ASSERT_APPKIT_THREAD; // TODO: create generic AWT assert } - [AWTWindow synthesizeMouseEnteredExitedEventsForAllWindows]; - NSRect frame = ConvertNSScreenRect(env, [self.nsWindow frame]); static JNF_MEMBER_CACHE(jm_deliverMoveResizeEvent, jc_CPlatformWindow, "deliverMoveResizeEvent", "(IIIIZ)V"); @@ -480,6 +478,8 @@ AWT_ASSERT_APPKIT_THREAD; (jint)frame.size.height, (jboolean)[self.nsWindow inLiveResize]); (*env)->DeleteLocalRef(env, platformWindow); + + [AWTWindow synthesizeMouseEnteredExitedEventsForAllWindows]; } - (void)windowDidMove:(NSNotification *)notification { diff --git a/test/java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java b/test/java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java index a018b27e3f5a6452ab00b0a5997b5904b102a5f3..4b8f92d520714f537256a2e708020bab76c54d86 100644 --- a/test/java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java +++ b/test/java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java @@ -61,6 +61,12 @@ public class FullscreenEnterEventTest { return; } + //Move the mouse out, because it could interfere with the test. + Robot r = Util.createRobot(); + Util.waitForIdle(r); + r.mouseMove(0, 0); + Util.waitForIdle(r); + SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { @@ -69,7 +75,6 @@ public class FullscreenEnterEventTest { }); //Move the mouse away from the frame and check the View-base full screen mode - Robot r = Util.createRobot(); Util.waitForIdle(r); r.mouseMove(500, 500); Util.waitForIdle(r); @@ -92,6 +97,7 @@ public class FullscreenEnterEventTest { }); //Test native full screen support + Util.waitForIdle(r); Point fullScreenButtonPos = frame.getLocation(); fullScreenButtonPos.translate(frame.getWidth() - 10, 10); r.mouseMove(fullScreenButtonPos.x, fullScreenButtonPos.y);