private static int HandleXlibError(UIntPtr display, XErrorEvent *errorEvent) { // Due to the asynchronous nature of Xlib, there can be a race between // the window being deleted and it being unmapped. This ignores the warning // raised by the unmap event in that scenario, as the call to XGetWindowProperty // will fail. if ((errorEvent->error_code != BadWindow) || (errorEvent->request_code != X_GetProperty)) { ThrowExternalException(nameof(XErrorHandler), errorEvent->error_code); } return(0); }
private static int HandleXlibError(IntPtr display, XErrorEvent *errorEvent) { // Due to the asynchronous nature of Xlib, there can be a race between // the window being deleted and it being unmapped. This ignores the warning // raised by the unmap event in that scenario, as the call to XGetWindowProperty // will fail. var errorCode = (XlibErrorCode)errorEvent->error_code; var requestCode = (XlibRequestCode)errorEvent->request_code; if ((errorCode != XlibErrorCode.BadWindow) || (requestCode != XlibRequestCode.GetProperty)) { ThrowExternalException(requestCode.ToString(), (int)errorCode); } return(0); }
private unsafe static int HandleX11Error(IntPtr display, XErrorEvent *e) { Console.WriteLine("X11 error: type={0}, serial={1}, code={2}", e->type, e->serial, e->error_code); return(0); }