input: Fix move-workspace-to-index being one off
Browse files at this commite8da89a430f4af0accfe80efe286b2cffd20a4aaParent: feae8c11 changed file +2 -0
- src/input/mod.rs +2 -0
src/input/mod.rsmodified+2 -0
| @@ -1295,12 +1295,14 @@ impl State { | |||
| 1295 | self.niri.queue_redraw_all(); | 1295 | self.niri.queue_redraw_all(); |
| 1296 | } | 1296 | } |
| 1297 | Action::MoveWorkspaceToIndex(new_idx) => { | 1297 | Action::MoveWorkspaceToIndex(new_idx) => { |
| 1298 | + let new_idx = new_idx.saturating_sub(1); | ||
| 1298 | self.niri.layout.move_workspace_to_idx(None, new_idx); | 1299 | self.niri.layout.move_workspace_to_idx(None, new_idx); |
| 1299 | // FIXME: granular | 1300 | // FIXME: granular |
| 1300 | self.niri.queue_redraw_all(); | 1301 | self.niri.queue_redraw_all(); |
| 1301 | } | 1302 | } |
| 1302 | Action::MoveWorkspaceToIndexByRef { new_idx, reference } => { | 1303 | Action::MoveWorkspaceToIndexByRef { new_idx, reference } => { |
| 1303 | if let Some(res) = self.niri.find_output_and_workspace_index(reference) { | 1304 | if let Some(res) = self.niri.find_output_and_workspace_index(reference) { |
| 1305 | + let new_idx = new_idx.saturating_sub(1); | ||
| 1304 | self.niri.layout.move_workspace_to_idx(Some(res), new_idx); | 1306 | self.niri.layout.move_workspace_to_idx(Some(res), new_idx); |
| 1305 | // FIXME: granular | 1307 | // FIXME: granular |
| 1306 | self.niri.queue_redraw_all(); | 1308 | self.niri.queue_redraw_all(); |