From bec1b8c6ea4b8c2eee95cb148af0d92c1e3de91b Mon Sep 17 00:00:00 2001 From: liufei Date: Thu, 7 Apr 2022 20:28:20 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=A0=E8=BE=B9=E6=98=BE=E7=A4=BA=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Util/ShowWindowFollowMouse.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Util/ShowWindowFollowMouse.cs b/Util/ShowWindowFollowMouse.cs index 93934a0..211ca4b 100644 --- a/Util/ShowWindowFollowMouse.cs +++ b/Util/ShowWindowFollowMouse.cs @@ -1,4 +1,5 @@ -using System; +using GeekDesk.Constant; +using System; using System.Windows; namespace GeekDesk.Util @@ -27,7 +28,7 @@ namespace GeekDesk.Util double left = SystemParameters.VirtualScreenLeft; double top = SystemParameters.VirtualScreenTop; double width = SystemParameters.VirtualScreenWidth; - double height = SystemParameters.WorkArea.Height + 20; + double height = SystemParameters.WorkArea.Height; double right = width - Math.Abs(left); double bottom = height - Math.Abs(top); @@ -73,12 +74,12 @@ namespace GeekDesk.Util if (p.X - afterWidth < left) { //判断是否在最左边缘 - window.Left = left; + window.Left = left - Constants.SHADOW_WIDTH; } else if (p.X + afterWidth > right) { //判断是否在最右边缘 - window.Left = right - window.Width; + window.Left = right - window.Width + Constants.SHADOW_WIDTH; } else { @@ -89,12 +90,12 @@ namespace GeekDesk.Util if (p.Y - afterHeight < top) { //判断是否在最上边缘 - window.Top = top; + window.Top = top - Constants.SHADOW_WIDTH; } else if (p.Y + afterHeight > bottom) { //判断是否在最下边缘 - window.Top = bottom - window.Height; + window.Top = bottom - window.Height + Constants.SHADOW_WIDTH; } else {