Skip to content

Commit

Permalink
fix(wm): focus prev idx when closing workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
LGUG2Z committed Dec 24, 2024
1 parent cced2a4 commit 2c08fbe
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions komorebi/src/process_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)?;
}
}
}
Expand Down

0 comments on commit 2c08fbe

Please sign in to comment.