GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.
Revert "refactor(infra,domain): remove custom `Point` struct; use `Point` from `System.Drawing` instead"
Lars Bergerd749dd29c899
diff --git a/GlazeWM.Domain/Monitors/MonitorService.cs b/GlazeWM.Domain/Monitors/MonitorService.csindex ecafc4e8..991f167b 100644--- a/GlazeWM.Domain/Monitors/MonitorService.cs+++ b/GlazeWM.Domain/Monitors/MonitorService.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Drawing;using System.Linq;using System.Windows.Forms;using GlazeWM.Domain.Common.Enums;@@ -54,7 +53,7 @@ namespace GlazeWM.Domain.Monitorspublic uint GetMonitorDpi(Screen screen){// Get a handle to the monitor from a `Screen`.- var point = new Point(screen.Bounds.Left + 1, screen.Bounds.Top + 1);+ var point = new System.Drawing.Point(screen.Bounds.Left + 1, screen.Bounds.Top + 1);var monitorHandle = MonitorFromPoint(point, MonitorFromPointFlags.MONITOR_DEFAULTTONEAREST);uint dpiX, dpiY;diff --git a/GlazeWM.Infrastructure/WindowsApi/Point.cs b/GlazeWM.Infrastructure/WindowsApi/Point.csnew file mode 100644index 00000000..93d8bd7f--- /dev/null+++ b/GlazeWM.Infrastructure/WindowsApi/Point.cs@@ -0,0 +1,11 @@+using System.Runtime.InteropServices;++namespace GlazeWM.Infrastructure.WindowsApi+{+ [StructLayout(LayoutKind.Sequential)]+ public struct Point+ {+ public int X;+ public int Y;+ }+}diff --git a/GlazeWM.Infrastructure/WindowsApi/WindowsApiService.cs b/GlazeWM.Infrastructure/WindowsApi/WindowsApiService.csindex 6dc1ac74..3ac35493 100644--- a/GlazeWM.Infrastructure/WindowsApi/WindowsApiService.cs+++ b/GlazeWM.Infrastructure/WindowsApi/WindowsApiService.cs@@ -1,6 +1,5 @@-using GlazeWM.Infrastructure.WindowsApi.Enums;+using GlazeWM.Infrastructure.WindowsApi.Enums;using System;-using System.Drawing;using System.Runtime.InteropServices;using System.Text;using System.Windows.Forms;@@ -382,6 +381,6 @@ namespace GlazeWM.Infrastructure.WindowsApi}[DllImport("User32.dll")]- public static extern IntPtr MonitorFromPoint(Point pt, MonitorFromPointFlags dwFlags);+ public static extern IntPtr MonitorFromPoint(System.Drawing.Point pt, MonitorFromPointFlags dwFlags);}}