src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java

Print this page

        

*** 45,54 **** --- 45,55 ---- import com.apple.laf.*; import com.apple.laf.ClientPropertyApplicator.Property; import com.sun.awt.AWTUtilities; public class CPlatformWindow extends CFRetainedResource implements PlatformWindow { + private native static void nativeActivateApp(); private native long nativeCreateNSWindow(long nsViewPtr,long ownerPtr, long styleBits, double x, double y, double w, double h); private static native void nativeSetNSWindowStyleBits(long nsWindowPtr, int mask, int data); private static native void nativeSetNSWindowMenuBar(long nsWindowPtr, long menuBarPtr); private static native Insets nativeGetNSWindowInsets(long nsWindowPtr); private static native void nativeSetNSWindowBounds(long nsWindowPtr, double x, double y, double w, double h);
*** 671,680 **** --- 672,687 ---- } @Override // PlatformWindow public void toFront() { final long nsWindowPtr = getNSWindowPtr(); + Container parent = getPeer().getTarget().getParent(); + if(DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow() + instanceof CEmbeddedFrame + && !((LWCToolkit)Toolkit.getDefaultToolkit()).isApplicationActive()) { + nativeActivateApp(); + } updateFocusabilityForAutoRequestFocus(false); nativePushNSWindowToFront(nsWindowPtr); updateFocusabilityForAutoRequestFocus(true); }