aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-04-04 12:10:17 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-04-04 16:51:09 +0300
commite8da89a430f4af0accfe80efe286b2cffd20a4aa (patch)
tree99b79d36d6e66e216b8d5f0b1ba54c44a5721751 /src
parentfeae8c15e605a499961588cbb30d9192c1926079 (diff)
downloadniri-e8da89a430f4af0accfe80efe286b2cffd20a4aa.tar.gz
niri-e8da89a430f4af0accfe80efe286b2cffd20a4aa.tar.bz2
niri-e8da89a430f4af0accfe80efe286b2cffd20a4aa.zip
input: Fix move-workspace-to-index being one off
Diffstat (limited to 'src')
-rw-r--r--src/input/mod.rs2
1 files changed, 2 insertions, 0 deletions
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();