From c5a0805e0fa3fc6868dd2ef9436ef929e3dcf017 Mon Sep 17 00:00:00 2001 From: pchelko Date: Fri, 22 Nov 2013 10:48:00 +0400 Subject: [PATCH] 8028485: [macosx] java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java fails Reviewed-by: anthony, serb --- src/macosx/native/sun/awt/AWTWindow.m | 4 ++-- .../Mouse/EnterExitEvents/FullscreenEnterEventTest.java | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/macosx/native/sun/awt/AWTWindow.m b/src/macosx/native/sun/awt/AWTWindow.m index 687fa6b4d..dcda6c3f9 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 a018b27e3..4b8f92d52 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); -- GitLab