LCL: Do not throw error inside SetActiveControl if we are embedded designer. issue #40833

(cherry picked from commit 34eace3587)

Co-authored-by: Željan Rikalo <zeljko@lazarus-ide.org>
This commit is contained in:
Maxim Ganetsky 2024-05-25 20:06:58 +00:00 committed by Maxim Ganetsky
parent 246652ca2a
commit 57e2fc3852

View File

@ -1860,7 +1860,7 @@ begin
// this form can focus => do some sanity checks and raise an exception to
// to help programmers to understand why a control is not focused
if (AWinControl = Self) or
(GetParentForm(AWinControl) <> Self) or
(GetParentForm(AWinControl, FDesigner = nil) <> Self) or
not ((csLoading in ComponentState) or AWinControl.CanFocus) then
begin
DebugLn(['TCustomForm.SetActiveControl ',DbgSName(Self),' AWinControl=',DbgSName(AWinControl),' GetParentForm(AWinControl)=',