From 09d4e2f1a1bc206c80d8d3287d070c70ec7fd63d Mon Sep 17 00:00:00 2001
From: chunhualin1 <chunhualin1@lenovo.com>
Date: 星期五, 14 八月 2026 20:00:52 +0800
Subject: [PATCH] Merge branch 'master' of http://git.linmoli.cn/r/Moli.Desktop

---
 src/Moli.Desktop/Interop/BottomDesktopLayerStrategy.cs |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/Moli.Desktop/Interop/BottomDesktopLayerStrategy.cs b/src/Moli.Desktop/Interop/BottomDesktopLayerStrategy.cs
index 45e0692..f7f5b18 100644
--- a/src/Moli.Desktop/Interop/BottomDesktopLayerStrategy.cs
+++ b/src/Moli.Desktop/Interop/BottomDesktopLayerStrategy.cs
@@ -1,3 +1,4 @@
+using Moli.Desktop.Configuration;
 using Moli.Desktop.Diagnostics;
 using Moli.Desktop.Layout;
 
@@ -17,16 +18,22 @@
 
     public bool IsSupported() => true;
 
-    public bool TryAttachDesktopWindow(IntPtr hwnd, RectD bounds, out string? error)
+    public bool TryAttachDesktopWindow(IntPtr hwnd, MonitorInfo monitor, RectD bounds, out string? error)
     {
         error = null;
+        var scale = monitor.Scale;
+        var x = (int)(bounds.X * scale);
+        var y = (int)(bounds.Y * scale);
+        var w = (int)(bounds.Width * scale);
+        var h = (int)(bounds.Height * scale);
+
         if (!NativeMethods.SetWindowPos(
             hwnd,
             NativeMethods.HwndBottom,
-            (int)bounds.X,
-            (int)bounds.Y,
-            (int)bounds.Width,
-            (int)bounds.Height,
+            x,
+            y,
+            w,
+            h,
             NativeMethods.SwpNoActivate | NativeMethods.SwpShowWindow))
         {
             error = $"SetWindowPos failed with {NativeMethods.GetLastError()}";

--
Gitblit v1.9.1