Skip to content

Commit

Permalink
fix(wm): address toggle-float container edge case
Browse files Browse the repository at this point in the history
This commit ensures that the focused container index on a workspace is
updated appropriately if the user calls toggle-float on the last
Container in a Ring. Previously, doing this would leave a ghost tile.
Now that we check if the focused_idx is still valid after removing an
empty Container from the workspace, users will no longer be left with a
ghost tile.
  • Loading branch information
LGUG2Z committed Apr 6, 2024
1 parent 5e714ca commit 251ec3d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions komorebi/src/workspace.rs
Expand Up @@ -843,6 +843,10 @@ impl Workspace {
if container.windows().is_empty() {
self.containers_mut().remove(focused_idx);
self.resize_dimensions_mut().remove(focused_idx);

if focused_idx == self.containers().len() {
self.focus_container(focused_idx - 1);
}
} else {
container.load_focused_window();
}
Expand Down

0 comments on commit 251ec3d

Please sign in to comment.