# HG changeset patch # User anashaty # Date 1427726818 -10800 # Node ID 013dd351eb8a2c23ae086f4f96395a3a8bbfebd2 # Parent e02d168adbc66a58cd8c2777004ddc2e27062b77 8074481: [macosx] Menu items are appearing on top of other windows Reviewed-by: ant, serb diff -r e02d168adbc6 -r 013dd351eb8a jdk/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java --- 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; diff -r e02d168adbc6 -r 013dd351eb8a jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java --- 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); } }