From f2de12dd8d20ba7a08d9c97f5ac9f51c94b693cc Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 14 Nov 2010 08:50:12 +0100 Subject: NEWT: Add optional eager native initialization ; Proper exception handling NEWT: Add optional eager native initialization of Display and Screen to overcome a possible chicken/egg situation. This is useful to be able to request the AbstractGraphicsDevice, via getGraphicsDevice(). Otherwise the abstract device won't be available before the dependent components (Screen and Window) are realized. Throw NativeWindowException in case native creation failed. --- src/nativewindow/native/x11/Xmisc.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/nativewindow/native') diff --git a/src/nativewindow/native/x11/Xmisc.c b/src/nativewindow/native/x11/Xmisc.c index 831d94636..290ec14cf 100644 --- a/src/nativewindow/native/x11/Xmisc.c +++ b/src/nativewindow/native/x11/Xmisc.c @@ -185,8 +185,14 @@ static int errorHandlerBlocked = 0 ; static int x11ErrorHandler(Display *dpy, XErrorEvent *e) { + fprintf(stderr, "Info: Nativewindow X11 Error: Display %p, Code 0x%X, errno %s", dpy, e->error_code, strerror(errno)); +#if 0 + // Since the X11 Error may happen anytime, a exception could mess up the JVM completely. + // Experienced this for remote displays issuing non supported commands, eg. glXCreateContextAttribsARB(..) + // _throwNewRuntimeException(NULL, x11ErrorHandlerJNIEnv, "Info: Nativewindow X11 Error: Display %p, Code 0x%X, errno %s", dpy, e->error_code, strerror(errno)); +#endif #if 0 if(NULL!=origErrorHandler) { -- cgit v1.2.3