src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m
branchmetal-prototype-branch
changeset 57416 e153174dba06
parent 54861 769dbf384c44
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m	Mon Jun 10 14:13:09 2019 +0530
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m	Fri Jun 21 12:08:37 2019 +0530
@@ -1171,6 +1171,8 @@
 JNF_COCOA_EXIT(env);
 }
 
+extern jboolean metalEnabled;
+
 /*
  * Class:     sun_lwawt_macosx_CPlatformWindow
  * Method:    nativeGetNSWindowInsets
@@ -1197,6 +1199,10 @@
     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");