changeset 11691:bb4f4297dda7

8074481: [macosx] Menu items are appearing on top of other windows Reviewed-by: ant, serb
author anashaty
date Mon, 30 Mar 2015 17:46:58 +0300
parents 8c996a225c1b
children 51d72921a268
files src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java src/java.desktop/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java	Fri Mar 27 16:13:45 2015 -0500
+++ b/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/src/java.desktop/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Fri Mar 27 16:13:45 2015 -0500
+++ b/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);
         }
     }