From 2f5fead85efb89fdd474b71872cbc50b4e078d64 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Mon, 7 Apr 2025 13:49:32 -0700 Subject: [PATCH] feat(wm): drop empty containers on ws update We shouldn't ever have empty containers, but never say never because someone on the Discord has an empty container with no Windows that continues to take up a tile. This commit adds a call to drop all containers without any windows whenever Workspace::update is called. --- komorebi/src/workspace.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/komorebi/src/workspace.rs b/komorebi/src/workspace.rs index 9fca6ec0..173dffed 100644 --- a/komorebi/src/workspace.rs +++ b/komorebi/src/workspace.rs @@ -480,6 +480,9 @@ impl Workspace { return Ok(()); } + // make sure we are never holding on to empty containers + self.containers_mut().retain(|c| !c.windows().is_empty()); + let container_padding = self .container_padding() .or(self.globals().container_padding)