1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-07-04 12:11:03 +02:00

fix: popups occasionally getting jumbled with multiple bars

This commit is contained in:
Jake Stanger 2023-05-29 14:01:42 +01:00
parent e036ff03c1
commit a5ecb363fd
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
5 changed files with 17 additions and 17 deletions

9
src/unique_id.rs Normal file
View file

@ -0,0 +1,9 @@
use std::sync::atomic::{AtomicUsize, Ordering};
static COUNTER: AtomicUsize = AtomicUsize::new(1);
/// Gets a `usize` ID value that is unique to the entire Ironbar instance.
/// This is just an `AtomicUsize` that increments every time this function is called.
pub fn get_unique_usize() -> usize {
COUNTER.fetch_add(1, Ordering::Relaxed)
}