8074481: [macosx] Menu items are appearing on top of other windows
Reviewed-by: ant, serb
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java Fri Mar 27 16:13:45 2015 -0500
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java Mon Mar 30 17:46:58 2015 +0300
@@ -1296,6 +1296,12 @@
}
KeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance();
+
+ if (!becomesFocused && kfmPeer.getCurrentFocusedWindow() != getTarget()) {
+ // late window focus lost event - ingoring
+ return;
+ }
+
kfmPeer.setCurrentFocusedWindow(becomesFocused ? getTarget() : null);
int eventID = becomesFocused ? WindowEvent.WINDOW_GAINED_FOCUS : WindowEvent.WINDOW_LOST_FOCUS;
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java Fri Mar 27 16:13:45 2015 -0500
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java Mon Mar 30 17:46:58 2015 +0300
@@ -164,7 +164,7 @@
}
// ignore focus "lost" native request as it may mistakenly
// deactivate active window (see 8001161)
- if (globalFocusedWindow == this && parentWindowActive) {
+ if (globalFocusedWindow == this) {
responder.handleWindowFocusEvent(parentWindowActive, null);
}
}