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

Print this page

        

@@ -49,10 +49,12 @@
     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);
+    private static native void nativeSetNSWindowStandardFrame(long nsWindowPtr,
+            double x, double y, double w, double h);
     private static native void nativeSetNSWindowMinMax(long nsWindowPtr, double minW, double minH, double maxW, double maxH);
     private static native void nativePushNSWindowToBack(long nsWindowPtr);
     private static native void nativePushNSWindowToFront(long nsWindowPtr);
     private static native void nativeSetNSWindowTitle(long nsWindowPtr, String title);
     private static native void nativeRevalidateNSWindowShadow(long nsWindowPtr);

@@ -472,10 +474,14 @@
     @Override // PlatformWindow
     public void setBounds(int x, int y, int w, int h) {
         nativeSetNSWindowBounds(getNSWindowPtr(), x, y, w, h);
     }
 
+    public void setMaximizedBounds(int x, int y, int w, int h) {
+        nativeSetNSWindowStandardFrame(getNSWindowPtr(), x, y, w, h);
+    }
+
     private boolean isMaximized() {
         return undecorated ? this.normalBounds != null
                 : CWrapper.NSWindow.isZoomed(getNSWindowPtr());
     }
 

@@ -981,19 +987,17 @@
             peer.notifyZoom(isZoomed);
         }
     }
 
     private void checkZoom() {
-        if (target instanceof Frame && isVisible()) {
-            Frame targetFrame = (Frame)target;
-            if (targetFrame.getExtendedState() != Frame.MAXIMIZED_BOTH && isMaximized()) {
+        int state = peer.getState();
+        if (state != Frame.MAXIMIZED_BOTH && isMaximized()) {
                 deliverZoom(true);
-            } else if (targetFrame.getExtendedState() == Frame.MAXIMIZED_BOTH && !isMaximized()) {
+        } else if (state == Frame.MAXIMIZED_BOTH && !isMaximized()) {
                 deliverZoom(false);
             }
         }
-    }
 
     private void deliverNCMouseDown() {
         if (peer != null) {
             peer.notifyNCMouseDown();
         }