From aed479890410e10031d96077a72a4cbdd621e6aa Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 27 Oct 2010 02:16:28 +0200 Subject: Minor: fix imports, JAWTUtil: query headless 1st (faster), NativeWindowFactory added nonAWT ToolkitLock create method --- .../javax/media/nativewindow/NativeWindowFactory.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/nativewindow/classes/javax/media') 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)}); -- cgit v1.2.3