aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-10-20 20:52:46 +0200
committerSven Gothel <[email protected]>2011-10-20 20:52:46 +0200
commit627083adaf1b38c17f42c72650c47103f17313ce (patch)
tree01d9651be896fb17e9e050856d976089e9cb4e9a /src/newt/classes/jogamp
parente9890fee4c2aa296aff2af5ff555908c6362fc5f (diff)
NEWT/OSX: Attempt to stabilize native parenting (ie w/ AWT) ; Add windowRepaint() callback
- act on positionChanged(..) only for realized windows, otherwise we could end in an AWT deadlock (AWT parent window). - add view parenting calls (addSubView/removeFromSuperview) - attachToParent after view configuration - allow concurrently view draw - add windowRepaint() callback (native -> java) - add more debug tracing
Diffstat (limited to 'src/newt/classes/jogamp')
-rw-r--r--src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java b/src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java
index 695a03e40..40989f94b 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java
@@ -159,7 +159,6 @@ public class MacWindow extends WindowImpl {
try {
if(DEBUG_IMPLEMENTATION) { System.err.println("MacWindow.CloseAction "+Thread.currentThread().getName()); }
if (getWindowHandle() != 0) {
- orderOut0(getWindowHandle());
close0(getWindowHandle());
}
} catch (Throwable t) {
@@ -376,7 +375,7 @@ public class MacWindow extends WindowImpl {
}
private void createWindow(final boolean recreate,
- PointImmutable pS, int width, int height,
+ final PointImmutable pS, final int width, final int height,
final boolean fullscreen) {
if(0!=getWindowHandle() && !recreate) {
@@ -397,14 +396,14 @@ public class MacWindow extends WindowImpl {
surfaceHandle = 0;
}
setWindowHandle(createWindow0(getParentWindowHandle(),
- pS.getX(), pS.getY(), width, height,
- config.getChosenCapabilities().isBackgroundOpaque(),
- fullscreen,
- (isUndecorated() ?
- NSBorderlessWindowMask :
- NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask),
- NSBackingStoreBuffered,
- getScreen().getIndex(), surfaceHandle));
+ pS.getX(), pS.getY(), width, height,
+ config.getChosenCapabilities().isBackgroundOpaque(),
+ fullscreen,
+ (isUndecorated() ?
+ NSBorderlessWindowMask :
+ NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask),
+ NSBackingStoreBuffered,
+ getScreen().getIndex(), surfaceHandle));
if (getWindowHandle() == 0) {
throw new NativeWindowException("Could create native window "+Thread.currentThread().getName()+" "+this);
}
@@ -418,8 +417,10 @@ public class MacWindow extends WindowImpl {
}
private void positionChanged(boolean defer, Point absPos) {
- position2ClientSpace(absPos);
- super.positionChanged(defer, absPos.getX(), absPos.getY());
+ if(getWindowHandle()!=0) {
+ position2ClientSpace(absPos);
+ super.positionChanged(defer, absPos.getX(), absPos.getY());
+ }
}
private Point position2ClientSpace(Point absPos) {