diff --git a/src/gl/x11/errors.rs b/src/gl/x11/errors.rs index 965d755..87d5287 100644 --- a/src/gl/x11/errors.rs +++ b/src/gl/x11/errors.rs @@ -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: {:?}",