< prev index next >

src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m

Print this page

        

@@ -1169,10 +1169,12 @@
     }];
 
 JNF_COCOA_EXIT(env);
 }
 
+extern jboolean metalEnabled;
+
 /*
  * Class:     sun_lwawt_macosx_CPlatformWindow
  * Method:    nativeGetNSWindowInsets
  * Signature: (J)Ljava/awt/Insets;
  */

@@ -1195,10 +1197,14 @@
 
     jint top = (jint)(frame.size.height - contentRect.size.height);
     jint left = (jint)(contentRect.origin.x - frame.origin.x);
     jint bottom = (jint)(contentRect.origin.y - frame.origin.y);
     jint right = (jint)(frame.size.width - (contentRect.size.width + left));
+    if (metalEnabled == JNI_TRUE) {
+        bottom -= top;
+        top = 0;
+    }
 
     static JNF_CLASS_CACHE(jc_Insets, "java/awt/Insets");
     static JNF_CTOR_CACHE(jc_Insets_ctor, jc_Insets, "(IIII)V");
     ret = JNFNewObject(env, jc_Insets_ctor, top, left, bottom, right);
 
< prev index next >