From c1f0aea06043e283e93eb9efcfab025b9a5fec97 Mon Sep 17 00:00:00 2001 From: Ottatop Date: Tue, 21 May 2024 10:49:55 -0500 Subject: [PATCH] Add `WindowId::reset` for testing --- src/window/window_state.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/window/window_state.rs b/src/window/window_state.rs index 85860c3..96bd3db 100644 --- a/src/window/window_state.rs +++ b/src/window/window_state.rs @@ -27,6 +27,12 @@ impl WindowId { 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. pub fn window(&self, pinnacle: &Pinnacle) -> Option { pinnacle