aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-07-05 14:32:00 +0200
committerSven Gothel <[email protected]>2012-07-05 14:32:00 +0200
commitfd06292d4a208cbd613f4bdce7cae12e075e70ec (patch)
tree75bf50a19e631c22f575f516248c5681dab3eda9 /src/newt/classes/jogamp
parent9b35c57425b0a5f6b789b9b43a62a8b64be51d86 (diff)
NativeWindow/Newt X11ErrorHandler enhancement / unification - don't throw exceptions. Handles also XAWT BadMatch X_SetInputFocus.
X11ErrorHandler code now dumps proper information about the opcode and error message and the running Java thread. Having propery "nativewindow.debug.X11Util.XErrorStackDump" or "nativewindow.debug=all' set, a stack trace is dumped. Since the X11ErrorHandler may catch an XAWT error: BadMatch X_SetInputFocus, we cannot throw an exception and better keep running.
Diffstat (limited to 'src/newt/classes/jogamp')
-rw-r--r--src/newt/classes/jogamp/newt/driver/x11/X11Display.java4
-rw-r--r--src/newt/classes/jogamp/newt/driver/x11/X11Window.java3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/x11/X11Display.java b/src/newt/classes/jogamp/newt/driver/x11/X11Display.java
index 9464b979b..8243fcf9d 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/X11Display.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/X11Display.java
@@ -49,7 +49,7 @@ public class X11Display extends DisplayImpl {
static {
NEWTJNILibLoader.loadNEWT();
- if ( !initIDs0() ) {
+ if ( !initIDs0(X11Util.XERROR_STACKDUMP) ) {
throw new NativeWindowException("Failed to initialize X11Display jmethodIDs");
}
@@ -139,7 +139,7 @@ public class X11Display extends DisplayImpl {
//----------------------------------------------------------------------
// Internals only
//
- private static native boolean initIDs0();
+ private static native boolean initIDs0(boolean debug);
private native void CompleteDisplay0(long handle);
diff --git a/src/newt/classes/jogamp/newt/driver/x11/X11Window.java b/src/newt/classes/jogamp/newt/driver/x11/X11Window.java
index 143b94a57..9a5074c29 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/X11Window.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/X11Window.java
@@ -230,6 +230,9 @@ public class X11Window extends WindowImpl {
// Internals only
//
+ private static final String getCurrentThreadName() { return Thread.currentThread().getName(); } // Callback for JNI
+ private static final void dumpStack() { Thread.dumpStack(); } // Callback for JNI
+
private final long getDisplayEDTHandle() {
return ((X11Display) getScreen().getDisplay()).getEDTHandle();
}