GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.
feat(domain): avoid resizing siblings in `DetachContainerHandler`
Lars Berger4504abec433d
diff --git a/GlazeWM.Domain/Containers/CommandHandlers/DetachContainerHandler.cs b/GlazeWM.Domain/Containers/CommandHandlers/DetachContainerHandler.csindex 13a951bb..0bef5945 100644--- a/GlazeWM.Domain/Containers/CommandHandlers/DetachContainerHandler.cs+++ b/GlazeWM.Domain/Containers/CommandHandlers/DetachContainerHandler.cs@@ -1,6 +1,4 @@-using System.Linq;-using GlazeWM.Domain.Containers.Commands;-using GlazeWM.Domain.Windows;+using GlazeWM.Domain.Containers.Commands;using GlazeWM.Domain.Workspaces;using GlazeWM.Infrastructure.Bussing;@@ -26,38 +24,18 @@ namespace GlazeWM.Domain.Containers.CommandHandlersparent.Children.Remove(childToRemove);parent.ChildFocusOrder.Remove(childToRemove);- if (childToRemove is TilingWindow || childToRemove is SplitContainer)- AdjustSiblingSizes(parent);-- return CommandResponse.Ok;- }-- private void AdjustSiblingSizes(Container parent)- {- // Siblings of the removed child.- var siblings = parent.Children;-var isEmptySplitContainer = parent is SplitContainer && !parent.HasChildren()&& !(parent is Workspace);- // If the parent of the removed child is an empty split container, remove- // the split container as well.+ // If the parent of the removed child is an empty split container, detach the split container+ // as well.if (isEmptySplitContainer){_bus.Invoke(new DetachContainerCommand(parent));- return;+ return CommandResponse.Ok;}- // TODO: Adjust SizePercentage of children based on their previous SizePercentage.-- var resizableSiblings = siblings.Where(container => container is IResizable);- double defaultPercent = 1.0 / resizableSiblings.Count();-- // Adjust `SizePercentage` of the siblings of the removed container.- foreach (var sibling in resizableSiblings)- (sibling as IResizable).SizePercentage = defaultPercent;-- _containerService.ContainersToRedraw.Add(parent);+ return CommandResponse.Ok;}}}