Skip to content

Commit ef86e56

Browse files
committed
Keep the first X11 error
1 parent aa1ad82 commit ef86e56

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/gl/x11/errors.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,13 @@ impl<'a> XErrorHandler<'a> {
4545
let err = *err;
4646

4747
CURRENT_X11_ERROR.with(|mutex| match mutex.lock() {
48-
Ok(mut current_error) => {
48+
// If multiple errors occur, keep the first one since that's likely going to be the
49+
// cause of the other errors
50+
Ok(mut current_error) if current_error.is_none() => {
4951
*current_error = Some(err);
5052
0
5153
}
54+
Ok(_) => 0,
5255
Err(e) => {
5356
eprintln!(
5457
"[FATAL] raw-gl-context: Failed to lock for X11 Error Handler: {:?}",

0 commit comments

Comments
 (0)