From 9dcd8bba63cfbcd6e72c855065cf4dafdbcf037e Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 20 Mar 2013 17:23:17 +0100 Subject: OSX/NEWT: Fix visible -> false when closing and reparenting window. This lead to non functional recreational reparenting. OSX recreational reparenting moves the saved GLEventListenerState at destroy to the new dawable/surface, which must be valid. The flaky visible state caused seemingly random reparenting failures. - WindowImpl.ReparentActionRecreate.run() set 'visible:=true', which circumvented OSX to wait for actual realization. - OSX WindowDriver.closeNative(): Issue visibleChanged(true, false); ASAP --- src/newt/classes/jogamp/newt/WindowImpl.java | 1 - src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/newt/classes') diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index c01f880fc..45100421a 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -1275,7 +1275,6 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer final RecursiveLock _lock = windowLock; _lock.lock(); try { - visible = true; if(DEBUG_IMPLEMENTATION) { System.err.println("Window.reparentWindow: ReparentActionRecreate ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+Display.hashCodeNullSafe(parentWindow)); } diff --git a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java index 653e90e3b..965138ddf 100644 --- a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java @@ -80,10 +80,11 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl try { if(DEBUG_IMPLEMENTATION) { System.err.println("MacWindow.CloseAction "+Thread.currentThread().getName()); } final long handle = getWindowHandle(); + visibleChanged(true, false); setWindowHandle(0); surfaceHandle = 0; sscSurfaceHandle = 0; - isOffscreenInstance = false; + isOffscreenInstance = false; if (0 != handle) { OSXUtil.RunOnMainThread(false, new Runnable() { public void run() { @@ -284,7 +285,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl 0 != ( FLAG_CHANGE_PARENTING & flags) || 0 != ( FLAG_CHANGE_FULLSCREEN & flags) ) { if(isOffscreenInstance) { - createWindow(true, 0 != getWindowHandle(), pClientLevelOnSreen, 64, 64, false, false, false); + createWindow(true, 0 != getWindowHandle(), pClientLevelOnSreen, 64, 64, false, setVisible, false); } else { createWindow(false, 0 != getWindowHandle(), pClientLevelOnSreen, width, height, 0 != ( FLAG_IS_FULLSCREEN & flags), setVisible, 0 != ( FLAG_IS_ALWAYSONTOP & flags)); @@ -488,7 +489,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl public void run() { initWindow0( parentWin, newWin, pS.getX(), pS.getY(), width, height, - isOpaque, fullscreen, visible, getScreen().getIndex(), surfaceHandle); + isOpaque, fullscreen, visible && !offscreenInstance, getScreen().getIndex(), surfaceHandle); if( offscreenInstance ) { orderOut0(0!=parentWin ? parentWin : newWin); } else { -- cgit v1.2.3