mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-17 22:39:46 +02:00
fix(wm): update focused idx on cross-monitor moves
This commit ensures that in situations where the last container on a monitor is moved to an adjacent monitor, the focused container index of the origin monitor will be appropriately decremented.
This commit is contained in:
@@ -1366,6 +1366,8 @@ impl WindowManager {
|
||||
anyhow!("could not remove container at given origin index")
|
||||
})?;
|
||||
|
||||
self.focused_workspace_mut()?.focus_previous_container();
|
||||
|
||||
// focus the target monitor
|
||||
self.focus_monitor(target_monitor_idx)?;
|
||||
|
||||
|
||||
@@ -1376,7 +1376,7 @@ impl Workspace {
|
||||
vec
|
||||
}
|
||||
|
||||
fn focus_previous_container(&mut self) {
|
||||
pub fn focus_previous_container(&mut self) {
|
||||
let focused_idx = self.focused_container_idx();
|
||||
|
||||
if focused_idx != 0 {
|
||||
|
||||
Reference in New Issue
Block a user