1
0
Fork 0

Keep the first X11 error

This commit is contained in:
Robbert van der Helm 2022-03-07 18:17:50 +01:00
parent aa1ad823ce
commit ef86e56ac7

View file

@ -45,10 +45,13 @@ impl<'a> XErrorHandler<'a> {
let err = *err;
CURRENT_X11_ERROR.with(|mutex| match mutex.lock() {
Ok(mut current_error) => {
// If multiple errors occur, keep the first one since that's likely going to be the
// cause of the other errors
Ok(mut current_error) if current_error.is_none() => {
*current_error = Some(err);
0
}
Ok(_) => 0,
Err(e) => {
eprintln!(
"[FATAL] raw-gl-context: Failed to lock for X11 Error Handler: {:?}",