mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-11 15:42:43 +02:00
fix(wm): add bounds checking in move cmd
This commit ensures that when there is only one container on the target workspace in a cross-monitor move, meaning that there won't be one swapped back, we only decrement the focused container index on the origin workspace if there is a focused container at an index greater than 0. fix #209
This commit is contained in:
@@ -1047,8 +1047,10 @@ impl WindowManager {
|
|||||||
let origin_workspace =
|
let origin_workspace =
|
||||||
self.focused_workspace_for_monitor_idx_mut(origin_monitor_idx)?;
|
self.focused_workspace_for_monitor_idx_mut(origin_monitor_idx)?;
|
||||||
|
|
||||||
origin_workspace
|
if origin_workspace.focused_container_idx() != 0 {
|
||||||
.focus_container(origin_workspace.focused_container_idx() - 1);
|
origin_workspace
|
||||||
|
.focus_container(origin_workspace.focused_container_idx() - 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user