mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 01:48:03 +02:00
lcl: fixed TCustomForm.GetMonitor to avoid calling SetBounds
This commit is contained in:
parent
819e17fc38
commit
174cf206d4
@ -2358,7 +2358,7 @@ begin
|
||||
end;
|
||||
|
||||
function TCustomForm.GetMonitor: TMonitor;
|
||||
{$IFDEF EnableGetMonitor}
|
||||
|
||||
function GetDefaultMonitor: TMonitor;
|
||||
var
|
||||
aForm: TCustomForm;
|
||||
@ -2383,7 +2383,7 @@ function TCustomForm.GetMonitor: TMonitor;
|
||||
Result:=Screen.GetPrimaryMonitor;
|
||||
end;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
var
|
||||
ParentForm: TCustomForm;
|
||||
begin
|
||||
@ -2401,7 +2401,6 @@ begin
|
||||
if HandleAllocated then begin
|
||||
if (not HandleObjectShouldBeVisible) then
|
||||
begin
|
||||
{$IFDEF EnableGetMonitor}
|
||||
// hidden forms are not updated by DoSendBoundsToInterface
|
||||
if (fsFirstShow in FormState) then
|
||||
begin
|
||||
@ -2429,12 +2428,6 @@ begin
|
||||
TWSWinControlClass(WidgetSetClass).SetBounds(Self, Left, Top, Width, Height);
|
||||
Result := Screen.MonitorFromWindow(Handle, mdNearest);
|
||||
end;
|
||||
{$ELSE}
|
||||
// ensure widgetset has latest coordinates // invisible forms are not updated by DoSendBoundsToInterface
|
||||
if (not HandleObjectShouldBeVisible) then
|
||||
TWSWinControlClass(WidgetSetClass).SetBounds(Self, Left, Top, Width, Height);
|
||||
Result := Screen.MonitorFromWindow(Handle, mdNearest);
|
||||
{$ENDIF}
|
||||
end else
|
||||
Result := Screen.MonitorFromWindow(Handle, mdNearest);
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user