From e8da89a430f4af0accfe80efe286b2cffd20a4aa Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Fri, 4 Apr 2025 12:10:17 +0300 Subject: input: Fix move-workspace-to-index being one off --- src/input/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/input/mod.rs b/src/input/mod.rs index ba5d3dd3..28e254e4 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -1295,12 +1295,14 @@ impl State { self.niri.queue_redraw_all(); } Action::MoveWorkspaceToIndex(new_idx) => { + let new_idx = new_idx.saturating_sub(1); self.niri.layout.move_workspace_to_idx(None, new_idx); // FIXME: granular self.niri.queue_redraw_all(); } Action::MoveWorkspaceToIndexByRef { new_idx, reference } => { if let Some(res) = self.niri.find_output_and_workspace_index(reference) { + let new_idx = new_idx.saturating_sub(1); self.niri.layout.move_workspace_to_idx(Some(res), new_idx); // FIXME: granular self.niri.queue_redraw_all(); -- cgit