diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-08-29 15:04:20 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-09-01 23:47:19 -0700 |
| commit | 8eb34b2e185aa0e0affea450226369cd3f9e6a78 (patch) | |
| tree | 63084d7106403006d28dd3622c854330694ee58c /src/layout/monitor.rs | |
| parent | 74d1b1f40620a42c92c71ddfec658dc6b2de0dd7 (diff) | |
| download | niri-8eb34b2e185aa0e0affea450226369cd3f9e6a78.tar.gz niri-8eb34b2e185aa0e0affea450226369cd3f9e6a78.tar.bz2 niri-8eb34b2e185aa0e0affea450226369cd3f9e6a78.zip | |
Animate focus-workspace by idx/back and forth/previous
Deleting the test because it only made sense when no-animation was
special cased.
Diffstat (limited to 'src/layout/monitor.rs')
| -rw-r--r-- | src/layout/monitor.rs | 13 |
1 files changed, 4 insertions, 9 deletions
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<W: LayoutElement> Monitor<W> { 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<W: LayoutElement> Monitor<W> { 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); } } |
