mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-03-21 17:09:20 +01:00
fix(wm): address toggle-float container edge case
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.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user