diff options
author | Sven Gothel <[email protected]> | 2011-10-29 15:13:16 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-10-29 15:13:16 +0200 |
commit | 866cc2a35d922b0bcab8fd54c10ad6801d00080f (patch) | |
tree | 62642e348e9a8e7565c4e826963147e3c2ed56ec | |
parent | cf7851ba926c099f4a63dc621f66b2c839df73ea (diff) |
Nativewindow/OSX: GetLocationOnScreen() must use [win frame] for window height.
-rw-r--r-- | src/nativewindow/native/macosx/OSXmisc.m | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/nativewindow/native/macosx/OSXmisc.m b/src/nativewindow/native/macosx/OSXmisc.m index af71b4a0a..e19d5ecf7 100644 --- a/src/nativewindow/native/macosx/OSXmisc.m +++ b/src/nativewindow/native/macosx/OSXmisc.m @@ -112,15 +112,19 @@ JNIEXPORT jobject JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_GetLocationOnS } NSScreen* screen = [win screen]; NSRect screenRect = [screen frame]; - - NSRect viewFrame = [view frame]; + NSRect winFrame = [win frame]; r.origin.x = src_x; - r.origin.y = viewFrame.size.height - src_y; // y-flip for 0/0 top-left + r.origin.y = winFrame.size.height - src_y; // y-flip for 0/0 top-left r.size.width = 0; r.size.height = 0; // NSRect rS = [win convertRectToScreen: r]; // 10.7 NSPoint oS = [win convertBaseToScreen: r.origin]; + /** + NSLog(@"LOS.1: (bottom-left) %d/%d, screen-y[0: %d, h: %d], (top-left) %d/%d\n", + (int)oS.x, (int)oS.y, (int)screenRect.origin.y, (int) screenRect.size.height, + (int)oS.x, (int)(screenRect.origin.y + screenRect.size.height - oS.y)); */ + dest_x = (int) oS.x; dest_y = (int) screenRect.origin.y + screenRect.size.height - oS.y; |