diff options
Diffstat (limited to 'src/layout/monitor.rs')
| -rw-r--r-- | src/layout/monitor.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/layout/monitor.rs b/src/layout/monitor.rs index eb72242f..911e0480 100644 --- a/src/layout/monitor.rs +++ b/src/layout/monitor.rs @@ -569,12 +569,13 @@ impl<W: LayoutElement> Monitor<W> { self.workspaces.iter().position(|w| w.id() == id) } - pub fn switch_workspace(&mut self, idx: usize) { + pub fn switch_workspace(&mut self, idx: usize, animate: bool) { self.activate_workspace(min(idx, self.workspaces.len() - 1)); - // Don't animate this action. - self.workspace_switch = None; - self.clean_up_workspaces(); + if !animate { + self.workspace_switch = None; + self.clean_up_workspaces(); + } } pub fn switch_workspace_auto_back_and_forth(&mut self, idx: usize) { @@ -582,16 +583,16 @@ impl<W: LayoutElement> Monitor<W> { if idx == self.active_workspace_idx { if let Some(prev_idx) = self.previous_workspace_idx() { - self.switch_workspace(prev_idx); + self.switch_workspace(prev_idx, false); } } else { - self.switch_workspace(idx); + self.switch_workspace(idx, false); } } pub fn switch_workspace_previous(&mut self) { if let Some(idx) = self.previous_workspace_idx() { - self.switch_workspace(idx); + self.switch_workspace(idx, false); } } |
