diff options
author | Randolf Schultz <[email protected]> | 2013-11-28 14:55:03 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-11-28 14:55:03 +0100 |
commit | e9c711a86aa05f4f24c69972532833f5a98911a3 (patch) | |
tree | 691d01a02de553dd2c8f6d87ed90b1c56d4dc2a6 /src/nativewindow/classes | |
parent | eb9225c928b9a1a5660c865921fcd91f85cd1cd0 (diff) |
Bug 907 - Initial patch allowing Jogl to respond to other applications that try to retrieve window names
Diffstat (limited to 'src/nativewindow/classes')
-rw-r--r-- | src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java index 38a5b5bc6..0cf813ad5 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java +++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java @@ -59,10 +59,8 @@ public class GDIUtil implements ToolkitProperties { if( !initIDs0() ) { throw new NativeWindowException("GDI: Could not initialized native stub"); } - dummyWindowClassFactory = new RegisteredClassFactory(dummyWindowClassNameBase, getDummyWndProc0()); - if(DEBUG) { - System.out.println("GDI.initSingleton() dummyWindowClassFactory "+dummyWindowClassFactory); - } + long a = getDummyWndProc0(); + dummyWindowClassFactory = new RegisteredClassFactory(dummyWindowClassNameBase, a); isInit = true; } } @@ -94,11 +92,7 @@ public class GDIUtil implements ToolkitProperties { public static long CreateDummyWindow(int x, int y, int width, int height) { synchronized(dummyWindowSync) { dummyWindowClass = dummyWindowClassFactory.getSharedClass(); - if(DEBUG) { - System.out.println("GDI.CreateDummyWindow() dummyWindowClassFactory "+dummyWindowClassFactory); - System.out.println("GDI.CreateDummyWindow() dummyWindowClass "+dummyWindowClass); - } - return CreateDummyWindow0(dummyWindowClass.getHInstance(), dummyWindowClass.getName(), dummyWindowClass.getName(), x, y, width, height); + return CreateDummyWindowAndMessageLoop(dummyWindowClass.getHInstance(), dummyWindowClass.getName(), dummyWindowClass.getName(), x, y, width, height); } } @@ -108,7 +102,7 @@ public class GDIUtil implements ToolkitProperties { if( null == dummyWindowClass ) { throw new InternalError("GDI Error ("+dummyWindowClassFactory.getSharedRefCount()+"): SharedClass is null"); } - res = GDI.DestroyWindow(hwnd); + res = SendCloseMessage(hwnd); dummyWindowClassFactory.releaseSharedClass(); } return res; @@ -130,10 +124,13 @@ public class GDIUtil implements ToolkitProperties { public static native boolean DestroyWindowClass(long hInstance, String className); private static native boolean initIDs0(); - private static native long getDummyWndProc0(); + static native long getDummyWndProc0(); private static native Object GetRelativeLocation0(long src_win, long dest_win, int src_x, int src_y); private static native boolean IsChild0(long win); private static native boolean IsUndecorated0(long win); static native long CreateDummyWindow0(long hInstance, String className, String windowName, int x, int y, int width, int height); + + static native long CreateDummyWindowAndMessageLoop(long hInstance, String className, String windowName, int x, int y, int width, int height); + static native boolean SendCloseMessage(long win); } |