feat: expand launcher settings
This commit is contained in:
1 parent
e8d67322b0
commit
53191bc23b
35 files changed
+1540
-266
No files matched your search
@@ -9,15 +9,19 @@
|
||||
// used by the render layer to track per-toast animation state.
|
||||
|
||||
use std::collections::VecDeque;
|
||||
use std::sync::atomic::{AtomicU64, Ordering};
|
||||
use std::sync::atomic::{AtomicU64, AtomicUsize, Ordering};
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::time::Instant;
|
||||
|
||||
use std::sync::LazyLock;
|
||||
use tracing::Level;
|
||||
|
||||
const MAX_ERROR_EVENTS: usize = 50;
|
||||
static NEXT_ERROR_ID: AtomicU64 = AtomicU64::new(1);
|
||||
static MAX_ERROR_EVENTS: AtomicUsize = AtomicUsize::new(50);
|
||||
|
||||
pub(crate) fn set_max_error_events(max_events: usize) {
|
||||
MAX_ERROR_EVENTS.store(max_events.max(1), Ordering::Relaxed);
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ErrorEvent {
|
||||
@@ -38,7 +42,8 @@ pub fn push_error(event: ErrorEvent) {
|
||||
|
||||
events.push_back(event);
|
||||
|
||||
while events.len() > MAX_ERROR_EVENTS {
|
||||
let max_events = MAX_ERROR_EVENTS.load(Ordering::Relaxed);
|
||||
while events.len() > max_events {
|
||||
events.pop_front();
|
||||
}
|
||||
super::request_redraw();
|
||||
|
||||
Reference in new issue
Block a user