mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 01:49:27 +02:00
LCL: TCustomForm.MoveToDefaultPosition: use MonitorFromRect instead of center
git-svn-id: trunk@39874 -
This commit is contained in:
parent
d1e9068de2
commit
55574e2a90
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user