diff options
author | Sven Gothel <[email protected]> | 2010-10-27 02:16:28 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-10-27 02:16:28 +0200 |
commit | aed479890410e10031d96077a72a4cbdd621e6aa (patch) | |
tree | 2a7809d0fefb5b0a161f9affb3364e0051d52c1e /src/nativewindow/classes/javax | |
parent | b62cc2479c49d2a9913a297bcd0375e2351f7cba (diff) |
Minor: fix imports, JAWTUtil: query headless 1st (faster), NativeWindowFactory added nonAWT ToolkitLock create method
Diffstat (limited to 'src/nativewindow/classes/javax')
-rw-r--r-- | src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java index a269051b1..49b398b6f 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java +++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java @@ -323,6 +323,18 @@ public abstract class NativeWindowFactory { return NativeWindowFactoryImpl.getNullToolkitLock(); } + public static ToolkitLock createDefaultToolkitLockNoAWT(String type, long deviceHandle) { + if( TYPE_X11 == type ) { + if( 0== deviceHandle ) { + throw new RuntimeException("JAWTUtil.createDefaultToolkitLockNoAWT() called with NULL device but on X11"); + } + if( !isFirstUIActionOnProcess() ) { + return createX11ToolkitLock(deviceHandle); + } + } + return NativeWindowFactoryImpl.getNullToolkitLock(); + } + protected static ToolkitLock createX11AWTToolkitLock(long deviceHandle) { try { return (ToolkitLock) x11JAWTToolkitLockConstructor.newInstance(new Object[]{new Long(deviceHandle)}); |