From 706573fcda16e6af9079853559ec24fb403f19e3 Mon Sep 17 00:00:00 2001 From: owenc Date: Sun, 31 May 2020 00:23:01 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=B0=86GetMouseInScreen=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=B8=BAScreen.FromControl=EF=BC=8C=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E6=98=AF=E5=9C=A8=E8=87=AA=E5=8A=A8=E6=9C=80=E5=A4=A7?= =?UTF-8?q?=E5=8C=96=E8=BF=87=E7=A8=8B=E4=B8=AD=EF=BC=8C=E7=94=B1=E4=BA=8E?= =?UTF-8?q?=E7=AA=97=E4=BD=93=E6=98=AF=E5=90=91=E4=B8=8A=E5=81=9C=E9=9D=A0?= =?UTF-8?q?=E7=9A=84=EF=BC=8C=E7=AA=97=E4=BD=93=E7=9A=84=E5=A4=A7=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=8C=BA=E5=9F=9F=E9=83=BD=E5=9C=A8=E8=A6=81=E6=94=BE?= =?UTF-8?q?=E5=A4=A7=E7=9A=84=E5=B1=8F=E5=B9=95=E4=B8=8A=E3=80=82=E8=8B=A5?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E9=BC=A0=E6=A0=87=E4=BD=8D=E7=BD=AE=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E7=AA=97=E4=BD=93=E6=89=80=E5=A4=84=E5=B1=8F=E5=B9=95?= =?UTF-8?q?=EF=BC=8C=E5=8F=8C=E5=B1=8F=E4=B8=94=E5=89=AF=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=99=A8=E5=9C=A8=E4=B8=8B=E6=97=B6=EF=BC=8C=E5=9C=A8=E5=89=AF?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=99=A8=E4=B8=AD=E5=90=91=E9=A1=B6=E9=83=A8?= =?UTF-8?q?=E5=81=9C=E9=9D=A0=EF=BC=8C=E7=94=B1=E4=BA=8EAllScreens?= =?UTF-8?q?=E7=9A=84=E7=AC=AC=E4=B8=80=E4=B8=AA=E6=98=AF=E4=B8=BB=E5=B1=8F?= =?UTF-8?q?=E5=B9=95=EF=BC=8C=E5=BE=97=E5=88=B0=E7=9A=84=E9=9C=80=E6=94=BE?= =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E5=B9=95=E6=98=AF=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Forms/UIForm.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SunnyUI/Forms/UIForm.cs b/SunnyUI/Forms/UIForm.cs index 43edc29d..d65637b4 100644 --- a/SunnyUI/Forms/UIForm.cs +++ b/SunnyUI/Forms/UIForm.cs @@ -479,8 +479,8 @@ namespace Sunny.UI private void ShowMaximize(bool IsOnMoving = false) { - int screenIndex = GetMouseInScreen(MousePosition); - Screen screen = Screen.AllScreens[screenIndex]; + //int screenIndex = GetMouseInScreen(MousePosition); + Screen screen = Screen.FromControl(this); if (windowState == FormWindowState.Normal) { size = Size; @@ -585,8 +585,8 @@ namespace Sunny.UI if (!IsDisposed && FormMoveMouseDown) { - int screenIndex = GetMouseInScreen(PointToScreen(e.Location)); - Screen screen = Screen.AllScreens[screenIndex]; + //int screenIndex = GetMouseInScreen(PointToScreen(e.Location)); + Screen screen = Screen.FromControl(this); if (MousePosition.Y == screen.WorkingArea.Top && MaximizeBox) { ShowMaximize(true); From b4aed739ca4d0eb6a17fd97e9740a53f52012d4a Mon Sep 17 00:00:00 2001 From: owenc Date: Sun, 31 May 2020 00:30:34 +0800 Subject: [PATCH 2/3] =?UTF-8?q?Revert=20"=E5=B0=86GetMouseInScreen?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E6=9B=BF=E6=8D=A2=E4=B8=BAScreen.FromControl?= =?UTF-8?q?=EF=BC=8C=E5=8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?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E3=80=82"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 706573fcda16e6af9079853559ec24fb403f19e3. --- SunnyUI/Forms/UIForm.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SunnyUI/Forms/UIForm.cs b/SunnyUI/Forms/UIForm.cs index d65637b4..43edc29d 100644 --- a/SunnyUI/Forms/UIForm.cs +++ b/SunnyUI/Forms/UIForm.cs @@ -479,8 +479,8 @@ namespace Sunny.UI private void ShowMaximize(bool IsOnMoving = false) { - //int screenIndex = GetMouseInScreen(MousePosition); - Screen screen = Screen.FromControl(this); + int screenIndex = GetMouseInScreen(MousePosition); + Screen screen = Screen.AllScreens[screenIndex]; if (windowState == FormWindowState.Normal) { size = Size; @@ -585,8 +585,8 @@ namespace Sunny.UI if (!IsDisposed && FormMoveMouseDown) { - //int screenIndex = GetMouseInScreen(PointToScreen(e.Location)); - Screen screen = Screen.FromControl(this); + int screenIndex = GetMouseInScreen(PointToScreen(e.Location)); + Screen screen = Screen.AllScreens[screenIndex]; if (MousePosition.Y == screen.WorkingArea.Top && MaximizeBox) { ShowMaximize(true); From e9c84298c86f930553754cc06dc3b8f53ad3ce5a Mon Sep 17 00:00:00 2001 From: owenc Date: Sun, 31 May 2020 00:35:54 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BD=BF=E7=94=A8Screen.FromPosition?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=BF=AE=E5=A4=8DGetMouseInScreen=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E7=9A=84=E4=B8=8D=E8=B6=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Forms/UIForm.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SunnyUI/Forms/UIForm.cs b/SunnyUI/Forms/UIForm.cs index 43edc29d..a0762acb 100644 --- a/SunnyUI/Forms/UIForm.cs +++ b/SunnyUI/Forms/UIForm.cs @@ -479,8 +479,8 @@ namespace Sunny.UI private void ShowMaximize(bool IsOnMoving = false) { - int screenIndex = GetMouseInScreen(MousePosition); - Screen screen = Screen.AllScreens[screenIndex]; + //int screenIndex = GetMouseInScreen(MousePosition); + Screen screen = Screen.FromPoint(MousePosition); if (windowState == FormWindowState.Normal) { size = Size; @@ -585,8 +585,8 @@ namespace Sunny.UI if (!IsDisposed && FormMoveMouseDown) { - int screenIndex = GetMouseInScreen(PointToScreen(e.Location)); - Screen screen = Screen.AllScreens[screenIndex]; + //int screenIndex = GetMouseInScreen(PointToScreen(e.Location)); + Screen screen = Screen.FromPoint(MousePosition); if (MousePosition.Y == screen.WorkingArea.Top && MaximizeBox) { ShowMaximize(true);