summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/newt/classes/jogamp/newt/driver/x11/X11UnderlayTracker.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/x11/X11UnderlayTracker.java b/src/newt/classes/jogamp/newt/driver/x11/X11UnderlayTracker.java
index 523899abe..6e64e7025 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/X11UnderlayTracker.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/X11UnderlayTracker.java
@@ -67,6 +67,8 @@ public class X11UnderlayTracker implements WindowListener, KeyListener, MouseLis
private volatile MouseEvent lastMouse;
private volatile static ArrayHashMap<WindowImpl, WindowImpl> underlayWindowMap = new ArrayHashMap<WindowImpl, WindowImpl>(false, ArrayHashMap.DEFAULT_INITIAL_CAPACITY, ArrayHashMap.DEFAULT_LOAD_FACTOR);
private volatile static ArrayHashMap<WindowImpl, WindowImpl> overlayWindowMap = new ArrayHashMap<WindowImpl, WindowImpl>(false, ArrayHashMap.DEFAULT_INITIAL_CAPACITY, ArrayHashMap.DEFAULT_LOAD_FACTOR);
+ private final Display display;
+ private final Screen screen;
static {
/*
@@ -91,6 +93,20 @@ public class X11UnderlayTracker implements WindowListener, KeyListener, MouseLis
return tracker;
}
+ private X11UnderlayTracker() {
+ /* 1178 cc10: Fix regression caused by the fix for cc7.
+ * We no longer throw an ExceptionInInitializerError
+ * when X11 is not available.
+ *
+ * Fix 1178 cc10: We need to use an X11 resource in the constructor
+ * in order to throw an ExceptionInInitializerError if X11 is not available.
+ * We can resolve this by query for the
+ * X11 display and screen inside the constructor.
+ */
+ display = NewtFactory.createDisplay(NativeWindowFactory.TYPE_X11, null, false);
+ screen = NewtFactory.createScreen(display, 0);
+ }
+
@Override
public void windowResized(final WindowEvent e) {
final Object s = e.getSource();
@@ -187,8 +203,6 @@ public class X11UnderlayTracker implements WindowListener, KeyListener, MouseLis
*/
caps.setBackgroundOpaque(false);
- final Display display = NewtFactory.createDisplay(NativeWindowFactory.TYPE_X11, null, false);
- final Screen screen = NewtFactory.createScreen(display, 0);
WindowImpl underlayWindow = WindowImpl.create(null, 0, screen, caps);
/*