From 34739650914fbfaa1a4144e929e64be4ca54bf5c Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Fri, 24 Nov 2023 09:48:37 +0400 Subject: layout: Change workspace by idx functions to accept 0-based usize Makes more sense to do the converstion at the top of the call stack. --- src/input.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/input.rs') diff --git a/src/input.rs b/src/input.rs index 347ef6c5..b7ceffd1 100644 --- a/src/input.rs +++ b/src/input.rs @@ -240,6 +240,7 @@ impl State { self.niri.queue_redraw_all(); } Action::MoveWindowToWorkspace(idx) => { + let idx = idx.saturating_sub(1) as usize; self.niri.layout.move_to_workspace(idx); // FIXME: granular self.niri.queue_redraw_all(); @@ -255,6 +256,7 @@ impl State { self.niri.queue_redraw_all(); } Action::FocusWorkspace(idx) => { + let idx = idx.saturating_sub(1) as usize; self.niri.layout.switch_workspace(idx); // FIXME: granular self.niri.queue_redraw_all(); -- cgit