diff options
author | Sven Gothel <[email protected]> | 2012-10-28 14:09:04 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-10-28 14:09:04 +0100 |
commit | b7e84320dced5325bd7f7b4dda917b251e3915ab (patch) | |
tree | db7888bcc5b21a5f5424f9c9176b3508b2ae2382 | |
parent | cf9a4e236891ce2f6d9469a017e880eed704dea0 (diff) |
NEWT X11 Display: Ignore events w/ NULL window, instead of throwing a disturbing and fatal RuntimeException
-rw-r--r-- | src/newt/native/X11Display.c | 13 | ||||
-rw-r--r-- | src/newt/native/X11Event.c | 13 |
2 files changed, 12 insertions, 14 deletions
diff --git a/src/newt/native/X11Display.c b/src/newt/native/X11Display.c index 341455f0f..89cf75043 100644 --- a/src/newt/native/X11Display.c +++ b/src/newt/native/X11Display.c @@ -344,16 +344,16 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_x11_DisplayDriver_DispatchMessage XNextEvent(dpy, &evt); num_events--; - if( 0==evt.xany.window ) { - NewtCommon_throwNewRuntimeException(env, "event window NULL, bail out!"); - return ; - } - if(dpy!=evt.xany.display) { NewtCommon_throwNewRuntimeException(env, "wrong display, bail out!"); return ; } + if( 0==evt.xany.window ) { + DBG_PRINT( "X11: DispatchMessages dpy %p, Event %d - Window NULL, ignoring\n", (void*)dpy, (int)evt.type); + continue; + } + // DBG_PRINT( "X11: DispatchMessages dpy %p, win %p, Event %d\n", (void*)dpy, (void*)evt.xany.window, (int)evt.type); jwindow = getJavaWindowProperty(env, dpy, evt.xany.window, javaObjectAtom, @@ -365,8 +365,7 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_x11_DisplayDriver_DispatchMessage ); if(NULL==jwindow) { - fprintf(stderr, "Warning: NEWT X11 DisplayDispatch %p, Couldn't handle event %d for X11 window %p\n", - (void*)dpy, evt.type, (void*)evt.xany.window); + fprintf(stderr, "Warning: NEWT X11 DisplayDispatch %p, Couldn't handle event %d for X11 window %p\n", (void*)dpy, evt.type, (void*)evt.xany.window); continue; } diff --git a/src/newt/native/X11Event.c b/src/newt/native/X11Event.c index 5402ffe34..079203400 100644 --- a/src/newt/native/X11Event.c +++ b/src/newt/native/X11Event.c @@ -33,16 +33,16 @@ void X11EventPoll(JNIEnv *env, jobject obj, Display *dpy, jlong javaObjectAtom, XNextEvent(dpy, &evt); num_events--; - if( 0==evt.xany.window ) { - NewtCommon_throwNewRuntimeException(env, "event window NULL, bail out!"); - return ; - } - if(dpy!=evt.xany.display) { NewtCommon_throwNewRuntimeException(env, "wrong display, bail out!"); return ; } + if( 0==evt.xany.window ) { + DBG_PRINT( "X11: DispatchMessages dpy %p, Event %d - Window NULL, ignoring\n", (void*)dpy, (int)evt.type); + continue; + } + // DBG_PRINT( "X11: DispatchMessages dpy %p, win %p, Event %d\n", (void*)dpy, (void*)evt.xany.window, (int)evt.type); jwindow = getJavaWindowProperty(env, dpy, evt.xany.window, javaObjectAtom, @@ -54,8 +54,7 @@ void X11EventPoll(JNIEnv *env, jobject obj, Display *dpy, jlong javaObjectAtom, ); if(NULL==jwindow) { - fprintf(stderr, "Warning: NEWT X11 DisplayDispatch %p, Couldn't handle event %d for X11 window %p\n", - (void*)dpy, evt.type, (void*)evt.xany.window); + fprintf(stderr, "Warning: NEWT X11 DisplayDispatch %p, Couldn't handle event %d for X11 window %p\n", (void*)dpy, evt.type, (void*)evt.xany.window); continue; } |