From bd1c8685d10a82108f959aae5a2f39b5570446be Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 12 Jun 2011 02:55:29 +0200 Subject: X11/Newt Locking: Clarify dependency of XInitThreads() hack --- src/newt/classes/jogamp/newt/x11/X11Display.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/newt') diff --git a/src/newt/classes/jogamp/newt/x11/X11Display.java b/src/newt/classes/jogamp/newt/x11/X11Display.java index d4a83abe0..815395e2d 100644 --- a/src/newt/classes/jogamp/newt/x11/X11Display.java +++ b/src/newt/classes/jogamp/newt/x11/X11Display.java @@ -75,9 +75,14 @@ public class X11Display extends DisplayImpl { X11Util.closeDisplay(handle); throw e; } - aDevice = new X11GraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_UNIT, NativeWindowFactory.getNullToolkitLock()); - // aDevice = new X11GraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_UNIT, NativeWindowFactory.createDefaultToolkitLockNoAWT(NativeWindowFactory.TYPE_X11, handle)); - // aDevice = new X11GraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_UNIT); + + if(X11Util.XINITTHREADS_ALWAYS_ENABLED) { + // Hack: Force non X11Display locking, even w/ AWT and w/o isFirstUIActionOnProcess() + aDevice = new X11GraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_UNIT, NativeWindowFactory.getNullToolkitLock()); + } else { + // Proper: Use AWT/X11Display locking w/ AWT and X11Display locking only w/o isFirstUIActionOnProcess() + aDevice = new X11GraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_UNIT); + } } protected void closeNativeImpl() { -- cgit v1.2.3