Skip to content

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

feat(domain): added method for getting Window by handle to WindowService

Lars052504935f38
diff --git a/LarsWM.Domain/Windows/WindowService.cs b/LarsWM.Domain/Windows/WindowService.cs
index ef8f050f..7eaae70d 100644
--- a/LarsWM.Domain/Windows/WindowService.cs
+++ b/LarsWM.Domain/Windows/WindowService.cs
@@ -1,9 +1,16 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
+using System.Linq;
namespace LarsWM.Domain.Windows
{
- class WindowService
+ public class WindowService
{
public List<Window> Windows { get; set; } = new List<Window>();
+
+ public Window GetWindowByHandle(IntPtr handle)
+ {
+ return Windows.FirstOrDefault(w => w.Hwnd == handle);
+ }
}
}