Beispiel #1
0
static void x11IOErrorHandlerEnable(int onoff, JNIEnv * env) {
    if(onoff) {
        if(NULL==origIOErrorHandler) {
            setupJVMVars(env);
            origIOErrorHandler = XSetIOErrorHandler(x11IOErrorHandler);
        }
    } else {
        XSetIOErrorHandler(origIOErrorHandler);
        origIOErrorHandler = NULL;
    }
}
Beispiel #2
0
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;
        }
    }
}
Beispiel #3
0
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;
        }
    }
}