diff options
author | Sven Gothel <[email protected]> | 2015-08-11 02:46:56 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-08-11 02:46:56 +0200 |
commit | 49952af9b680402648c21ab3291bd9444629dd09 (patch) | |
tree | 682e4578852e4d9203586f08f7697cee8c22cd06 | |
parent | dd2c69bf942757bee9aae200770e7b4cbc58adb0 (diff) | |
parent | 36e9671177c690ebd71d93021b8f797487785dda (diff) |
Merge branch 'master' of https://github.com/xranby/jogl
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/x11/X11UnderlayTracker.java | 18 |
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); /* |