summaryrefslogtreecommitdiffstats
path: root/src/nativewindow
diff options
context:
space:
mode:
Diffstat (limited to 'src/nativewindow')
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java
index c42bcf816..3c197062a 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java
@@ -109,10 +109,14 @@ public class X11Util {
isX11LockAvailable = isXInitThreadsOK && !HAS_XLOCKDISPLAY_BUG ;
final long dpy = X11Lib.XOpenDisplay(null);
- try {
- nullDisplayName = X11Lib.XDisplayString(dpy);
- } finally {
- X11Lib.XCloseDisplay(dpy);
+ if(0 != dpy) {
+ try {
+ nullDisplayName = X11Lib.XDisplayString(dpy);
+ } finally {
+ X11Lib.XCloseDisplay(dpy);
+ }
+ } else {
+ nullDisplayName = "nil";
}
if(DEBUG) {