summaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/javax/media
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-05-26 19:04:41 +0200
committerSven Gothel <[email protected]>2014-05-26 19:04:41 +0200
commit759d90674d977bae24ba58684fad3830f7f0d40f (patch)
tree16c402b0cc667e7d4d7899f9be92756465a372db /src/nativewindow/classes/javax/media
parent56d60b36798fa8dae48bf2aa5e2de6f3178ab0d1 (diff)
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).
Diffstat (limited to 'src/nativewindow/classes/javax/media')
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java6
1 files changed, 5 insertions, 1 deletions
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 ) {