!8 修复副屏幕在下时停靠最大化失效的问题

Merge pull request !8 from mimr/master
This commit is contained in:
Sunny 2020-05-31 19:06:51 +08:00 committed by Gitee
commit 11dfc8c552

View File

@ -479,8 +479,8 @@ namespace Sunny.UI
private void ShowMaximize(bool IsOnMoving = false) private void ShowMaximize(bool IsOnMoving = false)
{ {
int screenIndex = GetMouseInScreen(MousePosition); //int screenIndex = GetMouseInScreen(MousePosition);
Screen screen = Screen.AllScreens[screenIndex]; Screen screen = Screen.FromPoint(MousePosition);
if (windowState == FormWindowState.Normal) if (windowState == FormWindowState.Normal)
{ {
size = Size; size = Size;
@ -585,8 +585,8 @@ namespace Sunny.UI
if (!IsDisposed && FormMoveMouseDown) if (!IsDisposed && FormMoveMouseDown)
{ {
int screenIndex = GetMouseInScreen(PointToScreen(e.Location)); //int screenIndex = GetMouseInScreen(PointToScreen(e.Location));
Screen screen = Screen.AllScreens[screenIndex]; Screen screen = Screen.FromPoint(MousePosition);
if (MousePosition.Y == screen.WorkingArea.Top && MaximizeBox) if (MousePosition.Y == screen.WorkingArea.Top && MaximizeBox)
{ {
ShowMaximize(true); ShowMaximize(true);