--- old/src/macosx/classes/sun/lwawt/LWWindowPeer.java 2014-07-22 19:39:10.000000000 +0400 +++ new/src/macosx/classes/sun/lwawt/LWWindowPeer.java 2014-07-22 19:39:09.000000000 +0400 @@ -105,6 +105,8 @@ private final SecurityWarningWindow warningWindow; + private volatile boolean targetFocusable; + /** * Current modal blocker or null. * @@ -182,6 +184,8 @@ updateAlwaysOnTopState(); updateMinimumSize(); + targetFocusable = getTarget().isFocusableWindow(); + final Shape shape = getTarget().getShape(); if (shape != null) { applyShape(Region.getInstance(shape, null)); @@ -240,13 +244,12 @@ if (!visible && warningWindow != null) { warningWindow.setVisible(false, false); } - + updateFocusableWindowState(); super.setVisibleImpl(visible); // TODO: update graphicsConfig, see 4868278 platformWindow.setVisible(visible); if (isSimpleWindow()) { KeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance(); - if (visible) { if (!getTarget().isAutoRequestFocus()) { return; @@ -262,6 +265,7 @@ } } } + } @Override @@ -397,6 +401,7 @@ @Override public void updateFocusableWindowState() { + targetFocusable = getTarget().isFocusableWindow(); platformWindow.updateFocusableWindowState(); } @@ -1219,14 +1224,18 @@ return window.isVisible() && window.isEnabled() && isFocusableWindow(); } + protected boolean isTargetFocusable() { + return targetFocusable; + } + private boolean isFocusableWindow() { - boolean focusable = getTarget().isFocusableWindow(); + boolean focusable = isTargetFocusable(); if (isSimpleWindow()) { LWWindowPeer ownerPeer = getOwnerFrameDialog(this); if (ownerPeer == null) { return false; } - return focusable && ownerPeer.getTarget().isFocusableWindow(); + return focusable && ownerPeer.isTargetFocusable(); } return focusable; }