Skip to content

GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.

fix(domain): set `LastFocusedContainer` of the focused container to `null` * Prevents issue where a workspace references a closed window

Lars0e73e310d8c4
diff --git a/LarsWM.Domain/Containers/CommandHandlers/CreateFocusStackHandler.cs b/LarsWM.Domain/Containers/CommandHandlers/CreateFocusStackHandler.cs
index 8ad354f0..69af4bb6 100644
--- a/LarsWM.Domain/Containers/CommandHandlers/CreateFocusStackHandler.cs
+++ b/LarsWM.Domain/Containers/CommandHandlers/CreateFocusStackHandler.cs
@@ -32,6 +32,10 @@ namespace LarsWM.Domain.Containers.CommandHandlers
target = target.Parent;
}
+ // Mark the end of the focus stack. Prevents a workspace from referencing
+ // a closed window if the last window in a workspace is closed.
+ target.LastFocusedContainer = null;
+
_bus.RaiseEvent(new FocusChangedEvent(command.FocusedContainer));
return CommandResponse.Ok;