aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes
diff options
context:
space:
mode:
authorXerxes Rånby <[email protected]>2015-08-10 18:28:42 +0200
committerXerxes Rånby <[email protected]>2015-08-10 18:32:15 +0200
commit36e9671177c690ebd71d93021b8f797487785dda (patch)
tree3730ab4429b420947c8ca6344119ba3c06e5eed6 /src/newt/classes
parentfe90427a84bbea6f23f59a533db300b3832a6a21 (diff)
Bug 1178: Fix cc10 regression caused by the fix for cc7.
Bug 1178 cc10: 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. Signed-off-by: Xerxes Rånby <[email protected]>
Diffstat (limited to 'src/newt/classes')
-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);
/*