src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java

Print this page

        

*** 41,50 **** --- 41,67 ---- private static volatile CEmbeddedFrame focusedWindow; private boolean parentWindowActive = true; 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() { if (getPeer() == null) { LWCToolkit toolkit = (LWCToolkit)Toolkit.getDefaultToolkit();