diff options
author | Sven Gothel <[email protected]> | 2010-12-09 23:31:14 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-12-09 23:31:14 +0100 |
commit | a92e315245f6cefb55a71572eab8b6c95e8041a3 (patch) | |
tree | 8de2a364fed04e928df41365e5e61cddb768ac9d /make/config | |
parent | da97bc022020546455b293aea25dba3ee59152f5 (diff) |
GDI: Fix CreateDummyWindow: Use local getModuleHandle(NULL) and synchronize factory method.
Diffstat (limited to 'make/config')
-rw-r--r-- | make/config/nativewindow/win32-CustomJavaCode.java | 18 | ||||
-rw-r--r-- | make/config/nativewindow/win32-lib.cfg | 2 |
2 files changed, 9 insertions, 11 deletions
diff --git a/make/config/nativewindow/win32-CustomJavaCode.java b/make/config/nativewindow/win32-CustomJavaCode.java index 54a7fa53a..0c1a3a402 100644 --- a/make/config/nativewindow/win32-CustomJavaCode.java +++ b/make/config/nativewindow/win32-CustomJavaCode.java @@ -1,28 +1,26 @@ - private static final long hInstance; - static { NWJNILibLoader.loadNativeWindow("win32"); - hInstance = initIDs0(); - if( 0 == hInstance ) { + + if( !initIDs0() ) { throw new NativeWindowException("GDI: Could not initialized native stub"); } } public static synchronized void initSingleton() { } - private static native long initIDs0(); + private static native boolean initIDs0(); - public static long getModuleHandle() { - return hInstance; - } + private static Object createDummyWindowSync = new Object(); public static long CreateDummyWindow(int x, int y, int width, int height) { - return CreateDummyWindow0(getModuleHandle(), x, y, width, height); + synchronized(createDummyWindowSync) { + return CreateDummyWindow0(x, y, width, height); + } } public static Point GetRelativeLocation(long src_win, long dest_win, int src_x, int src_y) { - return (Point) GetRelativeLocation0(src_win, dest_win, src_x, src_y); + return (Point) GetRelativeLocation0(src_win, dest_win, src_x, src_y); } private static native Object GetRelativeLocation0(long src_win, long dest_win, int src_x, int src_y); diff --git a/make/config/nativewindow/win32-lib.cfg b/make/config/nativewindow/win32-lib.cfg index 46c4f2f92..e140ed3aa 100644 --- a/make/config/nativewindow/win32-lib.cfg +++ b/make/config/nativewindow/win32-lib.cfg @@ -33,7 +33,7 @@ CustomCCode #include <stddef.h> Include ../intptr.cfg -CustomCCode extern HWND CreateDummyWindow0( HINSTANCE hInstance, int x, int y, int width, int height ) ; +CustomCCode extern HWND CreateDummyWindow0( int x, int y, int width, int height ) ; IncludeAs CustomJavaCode GDI win32-CustomJavaCode.java |