mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'CapsizeGlimmer/centering-cursor-error-spam' into 'master'
Prevent "Error setting/centering cursor position" message spam See merge request veloren/veloren!2902
This commit is contained in:
commit
2561f8e79f
@ -969,7 +969,11 @@ impl Window {
|
||||
d.y as f64 + self.cursor_position.y,
|
||||
))
|
||||
{
|
||||
error!("Error setting cursor position: {:?}", err);
|
||||
// Log this error once rather than every frame
|
||||
static SPAM_GUARD: std::sync::Once = std::sync::Once::new();
|
||||
SPAM_GUARD.call_once(|| {
|
||||
error!("Error setting cursor position: {:?}", err);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -994,7 +998,11 @@ impl Window {
|
||||
dimensions[1] / (2_f64),
|
||||
))
|
||||
{
|
||||
error!("Error centering cursor position: {:?}", err);
|
||||
// Log this error once rather than every frame
|
||||
static SPAM_GUARD: std::sync::Once = std::sync::Once::new();
|
||||
SPAM_GUARD.call_once(|| {
|
||||
error!("Error centering cursor position: {:?}", err);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user