aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes
diff options
context:
space:
mode:
Diffstat (limited to 'src/newt/classes')
-rw-r--r--src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
index e63a53524..029cee3da 100644
--- a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
+++ b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
@@ -145,6 +145,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
newtChild.setSize(clientArea.width, clientArea.height);
postSetSize = false;
}
+ if( isOSX ) newtChild.setPosition(parent.getLocation().x,parent.getLocation().y);
newtChild.windowRepaint(0, 0, clientArea.width, clientArea.height);
}
}
@@ -252,6 +253,9 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
super.dispose();
}
+ private Rectangle getSWTCanvasPosition() {
+ return super.getBounds();
+ }
/** @return this SWT Canvas NativeWindow representation, may be null in case it has not been realized. */
public NativeWindow getNativeWindow() { return nativeWindow; }
@@ -500,7 +504,8 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
if( isOSX ) {
final Point los = OSXUtil.GetLocationOnScreen(nativeWindowHandle, false, 0, 0);
// top-level position -> client window position
- los.set(los.getX() + insets.getLeftWidth(), los.getY() + insets.getTopHeight());
+ final Rectangle swtCanvasPosition = getSWTCanvasPosition();
+ los.set(swtCanvasPosition.x + los.getX() + insets.getLeftWidth(), swtCanvasPosition.y + los.getY() + insets.getTopHeight());
if(null!=point) {
return point.translate(los);
} else {