From 6d8d565dc27680aa4bc29f9586d71827671e558a Mon Sep 17 00:00:00 2001 From: thewh1teagle <61390950+thewh1teagle@users.noreply.github.com> Date: Fri, 17 Jan 2025 19:18:29 +0200 Subject: [PATCH] refactor(window-state): Change filter_callback from Arc> to Box --- plugins/window-state/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/window-state/src/lib.rs b/plugins/window-state/src/lib.rs index e8bf3f1f..1f4abdd6 100644 --- a/plugins/window-state/src/lib.rs +++ b/plugins/window-state/src/lib.rs @@ -321,7 +321,7 @@ impl WindowExtInternal for Window { #[derive(Default)] pub struct Builder { denylist: HashSet, - filter_callback: Option>>, + filter_callback: Option>, skip_initial_state: HashSet, state_flags: StateFlags, map_label: Option>, @@ -358,7 +358,7 @@ impl Builder { where F: Fn(&str) -> bool + Send + Sync + 'static, { - self.filter_callback = Some(Arc::new(Mutex::new(filter_callback))); + self.filter_callback = Some(Box::new(filter_callback)); self } @@ -432,7 +432,6 @@ impl Builder { // Check deny list callback if let Some(filter_callback) = &self.filter_callback { - let filter_callback = filter_callback.lock().unwrap(); // Don't save the state if the callback returns false if !filter_callback(label) { return;