From 3ab518e90eb4cf82bcb8b990d337a5e4a531136b Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 18 Aug 2012 11:46:01 +0200 Subject: GLProfile/NativeWindowFactory: Remove deprecated argument 'firstUIActionOnProcess' of initSingleton() method The notion of changing the threading behavior of native initialization was deprecated for over a year. The code still contained the bits and pieces, i.e. whether X11Util.initSingletion() is invoked before or after optional AWT initialization. This condition has been removed now and behavior is uniform, i.e. X11Util.initSingletion() is invoked after optional AWT initialization. - Removed GLProfile.initSingleton(boolean firstUIActionOnProcess), use remaining GLProfile.initSingleton() - Removed NativeWindowFactory.isFirstUIActionOnProcess() - Changed NativeWindowFactory.initSingleton(boolean firstUIActionOnProcess) to NativeWindowFactory.initSingleton() --- .../jogamp/nativewindow/NativeWindowFactoryImpl.java | 2 +- .../classes/jogamp/nativewindow/macosx/OSXUtil.java | 12 +++++------- .../classes/jogamp/nativewindow/windows/GDIUtil.java | 15 ++++++--------- .../classes/jogamp/nativewindow/x11/X11Util.java | 13 +++++++------ 4 files changed, 19 insertions(+), 23 deletions(-) (limited to 'src/nativewindow/classes/jogamp') diff --git a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java index 9e18439db..2c2a627a4 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java +++ b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java @@ -90,7 +90,7 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory { // Assume Linux, Solaris, etc. Should probably test for these explicitly. windowClassName = "jogamp.nativewindow.jawt.x11.X11JAWTWindow"; } else { - throw new IllegalArgumentException("OS " + Platform.getOSName() + " not yet supported"); + throw new IllegalArgumentException("Native windowing type " + windowingType + " (custom) not yet supported, platform reported native windowing type: "+getNativeWindowType(false)); } nativeWindowConstructor = ReflectionUtil.getConstructor( diff --git a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java index 894084fce..f5f735051 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java +++ b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java @@ -38,20 +38,18 @@ public class OSXUtil { private static boolean isInit = false; private static final boolean DEBUG = Debug.debug("OSXUtil"); - public static synchronized void initSingleton(boolean firstX11ActionOnProcess) { + public static synchronized void initSingleton() { if(!isInit) { + if(DEBUG) { + System.out.println("OSXUtil.initSingleton()"); + } if(!NWJNILibLoader.loadNativeWindow("macosx")) { throw new NativeWindowException("NativeWindow MacOSX native library load error."); } if( !initIDs0() ) { throw new NativeWindowException("MacOSX: Could not initialized native stub"); - } - - if(DEBUG) { - System.out.println("OSX.isFirstX11ActionOnProcess: "+firstX11ActionOnProcess); - } - + } isInit = true; } } diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java index d17a1898c..fda1649b6 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java +++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java @@ -41,24 +41,21 @@ public class GDIUtil { private static RegisteredClassFactory dummyWindowClassFactory; private static boolean isInit = false; - public static synchronized void initSingleton(boolean firstX11ActionOnProcess) { + public static synchronized void initSingleton() { if(!isInit) { synchronized(X11Util.class) { if(!isInit) { - isInit = true; + if(DEBUG) { + System.out.println("GDI.initSingleton()"); + } if(!NWJNILibLoader.loadNativeWindow("win32")) { throw new NativeWindowException("NativeWindow Windows native library load error."); } - if( !initIDs0() ) { throw new NativeWindowException("GDI: Could not initialized native stub"); } - - if(DEBUG) { - System.out.println("GDI.isFirstX11ActionOnProcess: "+firstX11ActionOnProcess); - } - - dummyWindowClassFactory = new RegisteredClassFactory(dummyWindowClassNameBase, getDummyWndProc0()); + dummyWindowClassFactory = new RegisteredClassFactory(dummyWindowClassNameBase, getDummyWndProc0()); + isInit = true; } } } diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java index 7b46a1df0..860238649 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java +++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java @@ -95,18 +95,20 @@ public class X11Util { private static Object setX11ErrorHandlerLock = new Object(); - @SuppressWarnings("unused") - public static void initSingleton(final boolean firstX11ActionOnProcess) { + public static void initSingleton() { if(!isInit) { synchronized(X11Util.class) { if(!isInit) { isInit = true; + if(DEBUG) { + System.out.println("X11UtilUtil.initSingleton()"); + } if(!NWJNILibLoader.loadNativeWindow("x11")) { throw new NativeWindowException("NativeWindow X11 native library load error."); } - final boolean callXInitThreads = XINITTHREADS_ALWAYS_ENABLED || firstX11ActionOnProcess; - final boolean isXInitThreadsOK = initialize0( XINITTHREADS_ALWAYS_ENABLED || firstX11ActionOnProcess, XERROR_STACKDUMP); + final boolean callXInitThreads = XINITTHREADS_ALWAYS_ENABLED ; + final boolean isXInitThreadsOK = initialize0( callXInitThreads, XERROR_STACKDUMP); isX11LockAvailable = isXInitThreadsOK && !HAS_XLOCKDISPLAY_BUG ; final long dpy = X11Lib.XOpenDisplay(null); @@ -124,8 +126,7 @@ public class X11Util { } if(DEBUG) { - System.err.println("X11Util firstX11ActionOnProcess: "+firstX11ActionOnProcess+ - ", requiresX11Lock "+requiresX11Lock+ + System.err.println("X11Util requiresX11Lock "+requiresX11Lock+ ", XInitThreads [called "+callXInitThreads+", OK "+isXInitThreadsOK+"]"+ ", isX11LockAvailable "+isX11LockAvailable+ ", X11 Display(NULL) <"+nullDisplayName+">"+ -- cgit v1.2.3