From 8eb34b2e185aa0e0affea450226369cd3f9e6a78 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Thu, 29 Aug 2024 15:04:20 +0300 Subject: Animate focus-workspace by idx/back and forth/previous Deleting the test because it only made sense when no-animation was special cased. --- src/layout/monitor.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/layout/monitor.rs') diff --git a/src/layout/monitor.rs b/src/layout/monitor.rs index df63a189..6635de9b 100644 --- a/src/layout/monitor.rs +++ b/src/layout/monitor.rs @@ -594,13 +594,8 @@ impl Monitor { self.workspaces.iter().position(|w| w.id() == id) } - pub fn switch_workspace(&mut self, idx: usize, animate: bool) { + pub fn switch_workspace(&mut self, idx: usize) { self.activate_workspace(min(idx, self.workspaces.len() - 1)); - - if !animate { - self.workspace_switch = None; - self.clean_up_workspaces(); - } } pub fn switch_workspace_auto_back_and_forth(&mut self, idx: usize) { @@ -608,16 +603,16 @@ impl Monitor { if idx == self.active_workspace_idx { if let Some(prev_idx) = self.previous_workspace_idx() { - self.switch_workspace(prev_idx, false); + self.switch_workspace(prev_idx); } } else { - self.switch_workspace(idx, false); + self.switch_workspace(idx); } } pub fn switch_workspace_previous(&mut self) { if let Some(idx) = self.previous_workspace_idx() { - self.switch_workspace(idx, false); + self.switch_workspace(idx); } } -- cgit