From 759d90674d977bae24ba58684fad3830f7f0d40f Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 26 May 2014 19:04:41 +0200 Subject: Bug 1012: Fix erroneous handling of multiple monitor coordinates on OSX with NEWT To properly convert Top-Left (TL) from/to Bottom-Left (BL) coordinates we need to utilize the given CGDisplay viewport (TL) and NSScreen (BL) to perform the y-flip. This is especially true for the case of having multiple monitors covering different viewports (mixed resolution). --- .../classes/javax/media/nativewindow/NativeWindowFactory.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/nativewindow/classes/javax/media') diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java index 1546bd909..5ef32a5aa 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java +++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java @@ -686,6 +686,10 @@ public abstract class NativeWindowFactory { return new WrappedWindow(config, surfaceHandle, hook, true, windowHandle); } + /** + * @param nw + * @return top-left client-area position in window units + */ public static PointImmutable getLocationOnScreen(NativeWindow nw) { final String nwt = NativeWindowFactory.getNativeWindowType(true); if( NativeWindowFactory.TYPE_X11 == nwt ) { @@ -693,7 +697,7 @@ public abstract class NativeWindowFactory { } else if( NativeWindowFactory.TYPE_WINDOWS == nwt ) { return GDIUtil.GetRelativeLocation(nw.getWindowHandle(), 0, 0, 0); } else if( NativeWindowFactory.TYPE_MACOSX == nwt ) { - return OSXUtil.GetLocationOnScreen(nw.getWindowHandle(), null == nw.getParent(), 0, 0); + return OSXUtil.GetLocationOnScreen(nw.getWindowHandle(), 0, 0); /** * FIXME: Needs service provider interface (SPI) for TK dependent implementation } else if( NativeWindowFactory.TYPE_BCM_VC_IV == nwt ) { -- cgit v1.2.3