mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 23:09:16 +02:00
lcl: fixed TCustomForm.GetMonitor when handleallocated and visible
This commit is contained in:
parent
46e5442514
commit
becdd42b6d
@ -2387,6 +2387,7 @@ function TCustomForm.GetMonitor: TMonitor;
|
|||||||
var
|
var
|
||||||
ParentForm: TCustomForm;
|
ParentForm: TCustomForm;
|
||||||
begin
|
begin
|
||||||
|
Result:=nil;
|
||||||
if Assigned(Parent) then
|
if Assigned(Parent) then
|
||||||
begin
|
begin
|
||||||
ParentForm := GetParentForm(Self);
|
ParentForm := GetParentForm(Self);
|
||||||
@ -2434,7 +2435,8 @@ begin
|
|||||||
TWSWinControlClass(WidgetSetClass).SetBounds(Self, Left, Top, Width, Height);
|
TWSWinControlClass(WidgetSetClass).SetBounds(Self, Left, Top, Width, Height);
|
||||||
Result := Screen.MonitorFromWindow(Handle, mdNearest);
|
Result := Screen.MonitorFromWindow(Handle, mdNearest);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end else
|
||||||
|
Result := Screen.MonitorFromWindow(Handle, mdNearest);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
Result := Screen.MonitorFromPoint(point(Left,Top));
|
Result := Screen.MonitorFromPoint(point(Left,Top));
|
||||||
|
Loading…
Reference in New Issue
Block a user