From 2c08fbe8f6f1d8d447c87c7490fa064a52da5d3b Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Mon, 23 Dec 2024 16:56:17 -0800 Subject: [PATCH] fix(wm): focus prev idx when closing workspace --- komorebi/src/process_command.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/komorebi/src/process_command.rs b/komorebi/src/process_command.rs index a1a19531..a53e624c 100644 --- a/komorebi/src/process_command.rs +++ b/komorebi/src/process_command.rs @@ -810,9 +810,7 @@ impl WindowManager { if let Some(monitor) = self.focused_monitor_mut() { let focused_workspace_idx = monitor.focused_workspace_idx(); - let last_focused_workspace = monitor - .last_focused_workspace() - .unwrap_or(focused_workspace_idx.saturating_sub(1)); + let next_focused_workspace_idx = focused_workspace_idx.saturating_sub(1); if let Some(workspace) = monitor.focused_workspace() { if monitor.workspaces().len() > 1 @@ -832,7 +830,7 @@ impl WindowManager { .remove(focused_workspace_idx) .is_some() { - self.focus_workspace(last_focused_workspace)?; + self.focus_workspace(next_focused_workspace_idx)?; } } }