fix(wm): avoid out of range container focus op

This commit ensures that when floating the sole window visible on a
workspace that the focused container index for the workspace will not be
decremented below 0.

re #787
This commit is contained in:
LGUG2Z
2024-04-25 18:30:50 -07:00
parent 3370e6acc5
commit 0b04e3ef93

View File

@@ -876,7 +876,7 @@ impl Workspace {
self.containers_mut().remove(focused_idx);
self.resize_dimensions_mut().remove(focused_idx);
if focused_idx == self.containers().len() {
if focused_idx == self.containers().len() && focused_idx != 0 {
self.focus_container(focused_idx - 1);
}
} else {