From 5b47372590ec715647ebbd75d70c41ec7a64485a Mon Sep 17 00:00:00 2001 From: Martin Hegedus Date: Tue, 2 Apr 2013 09:31:41 -0700 Subject: Fix Bug 705 - Make Mesa X11 driver < 8.0 use new Quirk DontCloseX11DisplayConnection --- .../classes/jogamp/nativewindow/x11/X11Util.java | 37 +++++++++++++++++++--- 1 file changed, 33 insertions(+), 4 deletions(-) (limited to 'src/nativewindow') diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java index c771cd67a..2fb780fa2 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java +++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java @@ -138,7 +138,13 @@ public class X11Util implements ToolkitProperties { hasX11_EXTENSION_ATIFGLEXTENSION = false; } hasThreadingIssues = ATI_HAS_MULTITHREADING_BUG && ( hasX11_EXTENSION_ATIFGLRXDRI || hasX11_EXTENSION_ATIFGLEXTENSION ); - markAllDisplaysUnclosable = ATI_HAS_XCLOSEDISPLAY_BUG && ( hasX11_EXTENSION_ATIFGLRXDRI || hasX11_EXTENSION_ATIFGLEXTENSION ); + // A check on nativewindow.debug.X11Util.HasX11CloseDisplayBug added March 30, 2013 + // Martin C. Hegedus + if (!markAllDisplaysUnclosable) { + markAllDisplaysUnclosable = ATI_HAS_XCLOSEDISPLAY_BUG && ( hasX11_EXTENSION_ATIFGLRXDRI || hasX11_EXTENSION_ATIFGLEXTENSION ); + if (Debug.isPropertyDefined("nativewindow.debug.X11Util.HasX11CloseDisplayBug", true)) + markAllDisplaysUnclosable = true; + } if(DEBUG) { System.err.println("X11Util.initSingleton(): OK "+isInitOK+"]"+ @@ -178,7 +184,10 @@ public class X11Util implements ToolkitProperties { synchronized(X11Util.class) { if(isInit) { final boolean isJVMShuttingDown = NativeWindowFactory.isJVMShuttingDown() ; - if(DEBUG || openDisplayMap.size() > 0 || reusableDisplayList.size() > 0 || pendingDisplayList.size() > 0) { + // Modified March 30, 2013 so output is not created under "expected" circumstances + // Martin C. Hegedus + if(DEBUG || ((openDisplayMap.size() > 0 || reusableDisplayList.size() > 0 || pendingDisplayList.size() > 0) && + !(reusableDisplayList.size() == pendingDisplayList.size() && markAllDisplaysUnclosable))) { System.err.println("X11Util.Display: Shutdown (JVM shutdown: "+isJVMShuttingDown+ ", open (no close attempt): "+openDisplayMap.size()+"/"+openDisplayList.size()+ ", reusable (open, marked uncloseable): "+reusableDisplayList.size()+ @@ -242,6 +251,20 @@ public class X11Util implements ToolkitProperties { return nullDisplayName; } + // Added March 30, 2013 + // Martin C. Hegedus + public static void markAllDisplaysUnclosable() { + synchronized(globalLock) { + markAllDisplaysUnclosable = true; + for(int i=0; i