static void x11IOErrorHandlerEnable(int onoff, JNIEnv * env) { if(onoff) { if(NULL==origIOErrorHandler) { setupJVMVars(env); origIOErrorHandler = XSetIOErrorHandler(x11IOErrorHandler); } } else { XSetIOErrorHandler(origIOErrorHandler); origIOErrorHandler = NULL; } }
void NativewindowCommon_x11ErrorHandlerEnable(JNIEnv * env, Display *dpy, int onoff, int quiet, int sync) { errorHandlerQuiet = quiet; if(onoff) { if(NULL==origErrorHandler) { setupJVMVars(env); origErrorHandler = XSetErrorHandler(x11ErrorHandler); if(sync && NULL!=dpy) { XSync(dpy, False); } } } else { if(NULL!=origErrorHandler) { if(sync && NULL!=dpy) { XSync(dpy, False); } XSetErrorHandler(origErrorHandler); origErrorHandler = NULL; } } }
static void NativewindowCommon_x11ErrorHandlerEnable(JNIEnv * env, Display *dpy, int force, int onoff, int quiet, int sync) { errorHandlerQuiet = quiet; if(onoff) { if(force || NULL==origErrorHandler) { XErrorHandler prevErrorHandler; setupJVMVars(env); prevErrorHandler = XSetErrorHandler(x11ErrorHandler); if(x11ErrorHandler != prevErrorHandler) { // if forced don't overwrite w/ orig w/ our handler origErrorHandler = prevErrorHandler; } if(sync && NULL!=dpy) { XSync(dpy, False); } } } else { if(NULL!=origErrorHandler) { if(sync && NULL!=dpy) { XSync(dpy, False); } XSetErrorHandler(origErrorHandler); origErrorHandler = NULL; } } }