Function winit::platform::x11::register_xlib_error_hook

source ·
pub fn register_xlib_error_hook(hook: XlibErrorHook)
Available on x11_platform only.
Expand description

Hook to winit’s xlib error handling callback.

This method is provided as a safe way to handle the errors coming from X11 when using xlib in external crates, like glutin for GLX access. Trying to handle errors by speculating with XSetErrorHandler is unsafe.

Be aware that your hook is always invoked and returning true from it will prevent winit from getting the error itself. It’s wise to always return false if you’re not initiated the Sync.