diff options
Diffstat (limited to 'src/nativewindow/classes')
-rw-r--r-- | src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java | 6 | ||||
-rw-r--r-- | src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java | 24 |
2 files changed, 8 insertions, 22 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 ) { diff --git a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java index 31b06d360..12e574ced 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java +++ b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java @@ -91,31 +91,13 @@ public class OSXUtil implements ToolkitProperties { } /** - * In case the <code>windowOrView</code> is top-level, - * you shall set <code>topLevel</code> to true where - * insets gets into account to compute the client position as follows: - * <pre> - if(topLevel) { - // top-level position -> client window position - final Insets insets = GetInsets(windowOrView); - los.setX(los.getX() + insets.getLeftWidth()); - los.setY(los.getY() + insets.getTopHeight()); - } - * </pre> * @param windowOrView - * @param topLevel * @param src_x * @param src_y - * @return the client position + * @return top-left client-area position in window units */ - public static Point GetLocationOnScreen(long windowOrView, boolean topLevel, int src_x, int src_y) { - final Point los = (Point) GetLocationOnScreen0(windowOrView, src_x, src_y); - if(topLevel) { - // top-level position -> client window position - final Insets insets = GetInsets(windowOrView); - los.set(los.getX() + insets.getLeftWidth(), los.getY() + insets.getTopHeight()); - } - return los; + public static Point GetLocationOnScreen(long windowOrView, int src_x, int src_y) { + return (Point) GetLocationOnScreen0(windowOrView, src_x, src_y); } public static Insets GetInsets(long windowOrView) { |