diff options
author | Martin Hegedus <[email protected]> | 2013-04-02 09:31:41 -0700 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-04-15 15:46:47 +0200 |
commit | 5b47372590ec715647ebbd75d70c41ec7a64485a (patch) | |
tree | 662ebf0af203cf10a48f66cb9777cf8e9400da6b /src/nativewindow | |
parent | 9104faa11c256cbe8687122bba3c54dbb398b4e0 (diff) |
Fix Bug 705 - Make Mesa X11 driver < 8.0 use new Quirk DontCloseX11DisplayConnection
Diffstat (limited to 'src/nativewindow')
-rw-r--r-- | src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java | 37 |
1 files changed, 33 insertions, 4 deletions
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<openDisplayList.size(); i++) + openDisplayList.get(i).setUncloseable(true); + for(int i=0; i<reusableDisplayList.size(); i++) + reusableDisplayList.get(i).setUncloseable(true); + for(int i=0; i<pendingDisplayList.size(); i++) + pendingDisplayList.get(i).setUncloseable(true); + } + } + public static boolean getMarkAllDisplaysUnclosable() { return markAllDisplaysUnclosable; } @@ -326,7 +349,11 @@ public class X11Util implements ToolkitProperties { XCloseDisplay(ndpy.getHandle()); num++; } - System.err.println("X11Util.closePendingDisplayConnections(): Closed "+num+" pending display connections"); + // Added DEBUG statement around print statement, March 30, 2013 + // Martin C. Hegedus + if(DEBUG) { + System.err.println("X11Util.closePendingDisplayConnections(): Closed "+num+" pending display connections"); + } } } return num; @@ -462,7 +489,9 @@ public class X11Util implements ToolkitProperties { namedDpy.removeRef(); if(!openDisplayList.remove(namedDpy)) { throw new RuntimeException("Internal: "+namedDpy); } - if(!namedDpy.isUncloseable()) { + // Modified March 30, 2013 + // Martin C. Hegedus + if(!(markAllDisplaysUnclosable || namedDpy.isUncloseable())) { XCloseDisplay(namedDpy.getHandle()); pendingDisplayList.remove(namedDpy); } else { |