Add WindowId::reset for testing

This commit is contained in:
Ottatop 2024-05-21 10:49:55 -05:00
parent b763adcb5a
commit c1f0aea060

View file

@ -27,6 +27,12 @@ impl WindowId {
Self(WINDOW_ID_COUNTER.fetch_add(1, Ordering::Relaxed)) Self(WINDOW_ID_COUNTER.fetch_add(1, Ordering::Relaxed))
} }
/// Reset the static window id counter to 0.
/// FIXME: remove statics
pub fn reset() {
WINDOW_ID_COUNTER.store(0, Ordering::Relaxed);
}
/// Get the window that has this WindowId. /// Get the window that has this WindowId.
pub fn window(&self, pinnacle: &Pinnacle) -> Option<WindowElement> { pub fn window(&self, pinnacle: &Pinnacle) -> Option<WindowElement> {
pinnacle pinnacle