From fffa8704181669e2379cb75c588232f4e43029a4 Mon Sep 17 00:00:00 2001 From: kappaOne Date: Tue, 25 Dec 2012 13:51:24 +0000 Subject: [PATCH] correct behavior on OS X Display.getY() by using the screen the window is on rather than the screen with keyboard focus --- src/native/macosx/org_lwjgl_opengl_Display.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/macosx/org_lwjgl_opengl_Display.m b/src/native/macosx/org_lwjgl_opengl_Display.m index fffe738b..20eae51a 100644 --- a/src/native/macosx/org_lwjgl_opengl_Display.m +++ b/src/native/macosx/org_lwjgl_opengl_Display.m @@ -395,7 +395,7 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nGetX(JNIEnv *env, jo JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nGetY(JNIEnv *env, jobject this, jobject window_handle) { MacOSXWindowInfo *window_info = (MacOSXWindowInfo *)(*env)->GetDirectBufferAddress(env, window_handle); - NSRect screenRect = [[NSScreen mainScreen] frame]; + NSRect screenRect = [[[window_info->view window] screen] frame]; NSRect winRect = [[window_info->view window] frame]; // get top corner of window frame, also flip coords so origin is in top left