--- old/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java 2014-04-09 14:41:45.758283900 +0400 +++ new/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java 2014-04-09 14:41:45.009188800 +0400 @@ -43,6 +43,23 @@ public CEmbeddedFrame() { show(); + + Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() { + public void eventDispatched(AWTEvent e) { + if (e instanceof WindowEvent && + ((WindowEvent)e).getID() == WindowEvent.WINDOW_CLOSED) { + WindowEvent we = (WindowEvent)e; + Window w = we.getWindow(); + if (w instanceof Dialog){ + Dialog d = (Dialog)w; + if(d.isModal() && d.getOwner() == CEmbeddedFrame.this && + CEmbeddedFrame.this.isParentWindowActive()){ + CEmbeddedFrame.this.synthesizeWindowActivation(true); + } + } + } + } + },WindowEvent.WINDOW_CLOSED); } public void addNotify() {