diff --git a/lcl/include/wincontrol.inc b/lcl/include/wincontrol.inc index 0b45dd537c..5b77346989 100644 --- a/lcl/include/wincontrol.inc +++ b/lcl/include/wincontrol.inc @@ -6681,7 +6681,7 @@ var var s: String; begin - s:='TWinControl.WMSize loop detected: '+DbgSName(Self)+' BoundsRealized='+dbgs(FBoundsRealized)+' NewBoundsRealized='+dbgs(NewBoundsRealized); + s:='TWinControl.WMSize loop detected, the widgetset does not like the LCL bounds or sends unneeded wmsize messages: '+DbgSName(Self)+' BoundsRealized='+dbgs(FBoundsRealized)+' NewBoundsRealized='+dbgs(NewBoundsRealized); if (OldClientSize.cx<>NewClientSize.cx) or (OldClientSize.cy<>NewClientSize.cy) then diff --git a/lcl/interfaces/carbon/carbondef.pp b/lcl/interfaces/carbon/carbondef.pp index 5159ac9dcf..e66d243620 100644 --- a/lcl/interfaces/carbon/carbondef.pp +++ b/lcl/interfaces/carbon/carbondef.pp @@ -461,11 +461,23 @@ end; procedure TCarbonWidget.UpdateLCLClientRect; var R: TRect; + ClientR: TRect; + LCLR: TRect; + LCLClientR: TRect; + RChanged: Boolean; + ClientChanged: Boolean; begin if not Resizing then begin GetBounds(R); - LCLObject.InvalidateClientRectCache(False); - LCLSendSizeMsg(LCLObject, R.Right - R.Left, R.Bottom - R.Top, Size_SourceIsInterface); + GetClientRect(ClientR); + LCLR:=LCLObject.BoundsRect; + LCLClientR:=LCLObject.ClientRect; + RChanged:=not CompareRect(@R,@LCLR); + ClientChanged:=not CompareRect(@ClientR,@LCLClientR); + if not ClientChanged then + LCLObject.InvalidateClientRectCache(False); + if RChanged or ClientChanged then + LCLSendSizeMsg(LCLObject, R.Right - R.Left, R.Bottom - R.Top, Size_SourceIsInterface); end; end;