GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.
feat(domain): add `Container` method for getting `WindowRect` with container's position/dimensions
Lars Berger66b73f733099
diff --git a/GlazeWM.Domain/Containers/Container.cs b/GlazeWM.Domain/Containers/Container.csindex 326a3eb3..ddc0caf4 100644--- a/GlazeWM.Domain/Containers/Container.cs+++ b/GlazeWM.Domain/Containers/Container.cs@@ -1,6 +1,7 @@using System;using System.Collections.Generic;using System.Linq;+using GlazeWM.Infrastructure.WindowsApi;namespace GlazeWM.Domain.Containers{@@ -113,6 +114,17 @@ namespace GlazeWM.Domain.Containerspublic bool HasSiblings() => Siblings.Count() > 0;+ public WindowRect ToRectangle()+ {+ return new WindowRect()+ {+ Left = X,+ Right = X + Width,+ Top = Y,+ Bottom = Y + Height,+ };+ }+public IEnumerable<Container> ChildrenOfType(Type type){return Children.Where(container => type.IsAssignableFrom(container.GetType()));