diff options
author | Sven Gothel <[email protected]> | 2010-04-23 02:49:00 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-04-23 02:49:00 +0200 |
commit | 5fb1d73fddc5c6297b66a640cd5c2720eee23472 (patch) | |
tree | 41527127504ad788afb79b37d78bc99660f16676 /src/newt | |
parent | b62a3af2d58ff52c0341f04cdc21d069a8051d31 (diff) |
Newt.AWTWindow: Set/Unset windowHandle (enables actual destroy call) / minor debug stuff
Diffstat (limited to 'src/newt')
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/Window.java | 24 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/awt/AWTWindow.java | 24 |
2 files changed, 33 insertions, 15 deletions
diff --git a/src/newt/classes/com/jogamp/newt/Window.java b/src/newt/classes/com/jogamp/newt/Window.java index d0977f4e4..b1f8b3977 100755 --- a/src/newt/classes/com/jogamp/newt/Window.java +++ b/src/newt/classes/com/jogamp/newt/Window.java @@ -109,6 +109,9 @@ public abstract class Window implements NativeWindow } else { window.createNative(parentWindowHandle, caps); } + if(DEBUG_WINDOW_EVENT) { + System.out.println("Window.create-1() done ("+Thread.currentThread()+", "+window+")"); + } return window; } catch (Throwable t) { t.printStackTrace(); @@ -142,6 +145,9 @@ public abstract class Window implements NativeWindow } else { window.createNative(0, caps); } + if(DEBUG_WINDOW_EVENT) { + System.out.println("Window.create-2() done ("+Thread.currentThread()+", "+window+")"); + } return window; } catch (Throwable t) { throw new NativeWindowException(t); @@ -212,14 +218,14 @@ public abstract class Window implements NativeWindow StringBuffer sb = new StringBuffer(); sb.append(getClass().getName()+"[Config "+config+ - ", WindowHandle "+toHexString(getWindowHandle())+ - ", SurfaceHandle "+toHexString(getSurfaceHandle())+ - ", Pos "+getX()+"/"+getY()+", size "+getWidth()+"x"+getHeight()+ - ", Visible "+isVisible()+ - ", Undecorated "+undecorated+ - ", Fullscreen "+fullscreen+ - ", "+screen+ - ", WrappedWindow "+getWrappedWindow()); + "\n, "+screen+ + "\n, WindowHandle "+toHexString(getWindowHandle())+ + "\n, SurfaceHandle "+toHexString(getSurfaceHandle())+ + "\n, Pos "+getX()+"/"+getY()+", size "+getWidth()+"x"+getHeight()+ + "\n, Visible "+isVisible()+ + "\n, Undecorated "+undecorated+ + "\n, Fullscreen "+fullscreen+ + "\n, WrappedWindow "+getWrappedWindow()); sb.append(", SurfaceUpdatedListeners num "+surfaceUpdatedListeners.size()+" ["); for (Iterator iter = surfaceUpdatedListeners.iterator(); iter.hasNext(); ) { @@ -304,7 +310,7 @@ public abstract class Window implements NativeWindow /** @param deep If true, the linked Screen and Display will be destroyed as well. */ public void destroy(boolean deep) { if(DEBUG_WINDOW_EVENT) { - System.out.println("Window.destroy() start (deep "+deep+" - "+Thread.currentThread()); + System.out.println("Window.destroy() start (deep "+deep+" - "+Thread.currentThread()+", "+this+")"); } synchronized(surfaceUpdatedListeners) { surfaceUpdatedListeners = new ArrayList(); diff --git a/src/newt/classes/com/jogamp/newt/awt/AWTWindow.java b/src/newt/classes/com/jogamp/newt/awt/AWTWindow.java index 98cd64ab8..7beeed44b 100644 --- a/src/newt/classes/com/jogamp/newt/awt/AWTWindow.java +++ b/src/newt/classes/com/jogamp/newt/awt/AWTWindow.java @@ -134,18 +134,30 @@ public class AWTWindow extends Window { } } }); + this.windowHandle = 1; // just a marker .. } protected void closeNative() { - runOnEDT(true, new Runnable() { - public void run() { - if(owningFrame && null!=frame) { + this.windowHandle = 0; // just a marker .. + if(null!=container) { + runOnEDT(true, new Runnable() { + public void run() { + container.setVisible(false); + container.remove(canvas); + container.setEnabled(false); + canvas.setEnabled(false); + } + }); + } + if(owningFrame && null!=frame) { + runOnEDT(true, new Runnable() { + public void run() { frame.dispose(); owningFrame=false; + frame = null; } - frame = null; - } - }); + }); + } } public boolean hasDeviceChanged() { |