int checkBadDrawable( Display* display, XErrorEvent* error ) { if( error->error_code == BadDrawable && error->request_code == 136 && error->minor_code == 3 ) { x_baddrawable_error = true; return 0; } else { // If the error does not exactly match the one from the driver bug, // handle it the normal way so we see it. return old_error_handler( display, error ); } }
/* * Race condition with window always possible, but especially needed to survive * if autostarted early */ static int error_handler(Display *display, XErrorEvent *event) { if (event->error_code == BadWindow) return 0; return old_error_handler(display, event); }