diff options
author | Sven Gothel <[email protected]> | 2010-05-05 15:17:06 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-05-05 15:17:06 +0200 |
commit | 6700db86ea0c14d8eee5b8a81ddd6e96b0832ea6 (patch) | |
tree | aae74a559bc63527fccca1fdbc8fda6dca4e341e /src | |
parent | 574a772703531da2854a566662af9c8b8f9770fe (diff) |
JAWT Windows Fix: Use the JAWT window handle entry [to return it]
Diffstat (limited to 'src')
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/windows/WindowsJAWTWindow.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/windows/WindowsJAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/windows/WindowsJAWTWindow.java index b23ad3f50..7d680dfa0 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/windows/WindowsJAWTWindow.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/windows/WindowsJAWTWindow.java @@ -56,6 +56,11 @@ public class WindowsJAWTWindow extends JAWTWindow { protected void initNative() throws NativeWindowException { } + public synchronized void invalidate() { + super.invalidate(); + windowHandle = 0; + } + public int lockSurface() throws NativeWindowException { int ret = super.lockSurface(); if(LOCK_SUCCESS != ret) { @@ -105,8 +110,9 @@ public class WindowsJAWTWindow extends JAWTWindow { super.unlockSurface(); return LOCK_SURFACE_NOT_READY; } + windowHandle = win32dsi.getHandle(); drawable = win32dsi.getHdc(); - if (drawable == 0) { + if (windowHandle == 0 || drawable == 0) { // Widget not yet realized ds.FreeDrawingSurfaceInfo(dsi); ds.Unlock(); @@ -157,6 +163,10 @@ public class WindowsJAWTWindow extends JAWTWindow { } } + public long getWindowHandle() { + return windowHandle; + } + // Variables for lockSurface/unlockSurface private JAWT_DrawingSurface ds; private JAWT_DrawingSurfaceInfo dsi; @@ -165,6 +175,8 @@ public class WindowsJAWTWindow extends JAWTWindow { private int profilingLockSurfaceTicks = 0; private long profilingUnlockSurfaceTime = 0; private int profilingUnlockSurfaceTicks = 0; - + + // lifetime: valid after lock, forever until invalidate + protected long windowHandle; } |