mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-11 20:00:30 +01:00
cocoa: sending LCL bounds change notifications only if bounds have actually changed, to prevent WM_Size loops
git-svn-id: trunk@57616 -
This commit is contained in:
parent
ea840fc089
commit
1a38dc5407
@ -1474,6 +1474,7 @@ class procedure TCocoaWSWinControl.SetBounds(const AWinControl: TWinControl;
|
||||
const ALeft, ATop, AWidth, AHeight: Integer);
|
||||
var
|
||||
cb : ICommonCallBack;
|
||||
r : TRect;
|
||||
begin
|
||||
if AWinControl.HandleAllocated then
|
||||
begin
|
||||
@ -1481,10 +1482,13 @@ begin
|
||||
writeln(Format('TCocoaWSWinControl.SetBounds: %s Bounds=%s',
|
||||
[AWinControl.Name, dbgs(Bounds(ALeft, ATop, AWidth, AHeight))]));
|
||||
{$ENDIF}
|
||||
NSObject(AWinControl.Handle).lclSetFrame(Bounds(ALeft, ATop, AWidth, AHeight));
|
||||
|
||||
cb := NSObject(AWinControl.Handle).lclGetCallback;
|
||||
if Assigned(cb) then cb.boundsDidChange(nil);
|
||||
r := NSObject(AWinControl.Handle).lclFrame;
|
||||
if not EqualRect(r, bounds(Aleft, ATop, AWidth, AHeight)) then
|
||||
begin
|
||||
NSObject(AWinControl.Handle).lclSetFrame(Bounds(ALeft, ATop, AWidth, AHeight));
|
||||
cb := NSObject(AWinControl.Handle).lclGetCallback;
|
||||
if Assigned(cb) then cb.boundsDidChange(nil);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user