src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m
branchmetal-prototype-branch
changeset 57416 e153174dba06
parent 54861 769dbf384c44
equal deleted inserted replaced
57400:978ffc56771f 57416:e153174dba06
  1169     }];
  1169     }];
  1170 
  1170 
  1171 JNF_COCOA_EXIT(env);
  1171 JNF_COCOA_EXIT(env);
  1172 }
  1172 }
  1173 
  1173 
       
  1174 extern jboolean metalEnabled;
       
  1175 
  1174 /*
  1176 /*
  1175  * Class:     sun_lwawt_macosx_CPlatformWindow
  1177  * Class:     sun_lwawt_macosx_CPlatformWindow
  1176  * Method:    nativeGetNSWindowInsets
  1178  * Method:    nativeGetNSWindowInsets
  1177  * Signature: (J)Ljava/awt/Insets;
  1179  * Signature: (J)Ljava/awt/Insets;
  1178  */
  1180  */
  1195 
  1197 
  1196     jint top = (jint)(frame.size.height - contentRect.size.height);
  1198     jint top = (jint)(frame.size.height - contentRect.size.height);
  1197     jint left = (jint)(contentRect.origin.x - frame.origin.x);
  1199     jint left = (jint)(contentRect.origin.x - frame.origin.x);
  1198     jint bottom = (jint)(contentRect.origin.y - frame.origin.y);
  1200     jint bottom = (jint)(contentRect.origin.y - frame.origin.y);
  1199     jint right = (jint)(frame.size.width - (contentRect.size.width + left));
  1201     jint right = (jint)(frame.size.width - (contentRect.size.width + left));
       
  1202     if (metalEnabled == JNI_TRUE) {
       
  1203         bottom -= top;
       
  1204         top = 0;
       
  1205     }
  1200 
  1206 
  1201     static JNF_CLASS_CACHE(jc_Insets, "java/awt/Insets");
  1207     static JNF_CLASS_CACHE(jc_Insets, "java/awt/Insets");
  1202     static JNF_CTOR_CACHE(jc_Insets_ctor, jc_Insets, "(IIII)V");
  1208     static JNF_CTOR_CACHE(jc_Insets_ctor, jc_Insets, "(IIII)V");
  1203     ret = JNFNewObject(env, jc_Insets_ctor, top, left, bottom, right);
  1209     ret = JNFNewObject(env, jc_Insets_ctor, top, left, bottom, right);
  1204 
  1210