From 8765ceb4f180cdc13c3fcb4172264b950e0d5f60 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 22 Nov 2018 10:21:27 +0000 Subject: [PATCH] ObjectInspector: Reduce calls to ComponentTree.Invalidate (changing the positon of FCurrentButton or FCurrentEdit in the OI-Grid can trigger a call to Resize of the Form, even so the Size did not change / Win10) git-svn-id: trunk@59622 - --- components/ideintf/objectinspector.pp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/ideintf/objectinspector.pp b/components/ideintf/objectinspector.pp index 1bd5786fc8..541bc978f4 100644 --- a/components/ideintf/objectinspector.pp +++ b/components/ideintf/objectinspector.pp @@ -701,6 +701,8 @@ type FOnShowOptions: TNotifyEvent; FOnUpdateRestricted: TNotifyEvent; FOnViewRestricted: TNotifyEvent; + FLastTreeSize: TRect; + // These event handlers are assigned at run-time, no need for default published section. procedure ComponentTreeDblClick(Sender: TObject); procedure ComponentTreeGetNodeImageIndex(APersistent: TPersistent; var AIndex: integer); @@ -5616,8 +5618,11 @@ end; procedure TObjectInspectorDlg.Resize; begin inherited Resize; - if Assigned(ComponentTree) then + // BUG: resize gets called, even if nothing changed + if Assigned(ComponentTree) and (FLastTreeSize <> ComponentTree.BoundsRect) then begin ComponentTree.Invalidate; // Update Scrollbars. + FLastTreeSize := ComponentTree.BoundsRect; + end; end; procedure TObjectInspectorDlg.ComponentTreeModified(Sender: TObject);