LCL: TCustomForm.MoveToDefaultPosition: use MonitorFromRect instead of center

git-svn-id: trunk@39874 -
This commit is contained in:
mattias 2013-01-17 13:10:54 +00:00
parent d1e9068de2
commit 55574e2a90

View File

@ -1219,7 +1219,7 @@ procedure TCustomForm.MoveToDefaultPosition;
// delphi compatibility: if no main form then DefaultMonitor has no effect
if Application.MainForm = nil then Exit;
// find the monitor of the center of the form (the boundaries might be on another monitor)
Source := Screen.MonitorFromPoint(Point(X+(Width div 2), Y+(Height div 2)));
Source := Screen.MonitorFromRect(Rect(X,Y,X+Width,Y+Height));
case DefaultMonitor of
dmDesktop:
Target := Source; // no need to move