mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-06 12:29:21 +01:00
LCL: added -dEnableActiveControl2 to avoid endless loop for docked forms
git-svn-id: trunk@28429 -
This commit is contained in:
parent
371fcb0928
commit
a9009de33a
@ -2258,6 +2258,9 @@ function TCustomForm.SetFocusedControl(Control: TWinControl): Boolean;
|
||||
|
||||
var
|
||||
ParentForm: TCustomForm;
|
||||
{$IFDEF EnableActiveControl2}
|
||||
CurControl: TWinControl;
|
||||
{$ENDIF}
|
||||
begin
|
||||
LastFocusedControl := Control;
|
||||
Result := False;
|
||||
@ -2323,6 +2326,22 @@ begin
|
||||
try
|
||||
if not Screen.SetFocusedForm(Self) then
|
||||
Exit;
|
||||
{$IFDEF EnableActiveControl2}
|
||||
// update ActiveControls of all parent forms
|
||||
CurControl := Control.Parent;
|
||||
while CurControl <> nil do
|
||||
begin
|
||||
if CurControl is TCustomForm then begin
|
||||
{$IFDEF VerboseFocus}
|
||||
if TCustomForm(CurControl).FActiveControl<>Control then
|
||||
debugln(['TCustomForm.SetFocusedControl Self=',DbgSName(Self),' SomeParent=',DbgSName(CurControl),' OldActiveControl=',DbgSName(TCustomForm(CurControl).FActiveControl),' New=',DbgSName(Control)]);
|
||||
{$ENDIF}
|
||||
TCustomForm(CurControl).FActiveControl := Control;
|
||||
TCustomForm(CurControl).FreeNotification(Control);
|
||||
end;
|
||||
CurControl := CurControl.Parent;
|
||||
end;
|
||||
{$ENDIF}
|
||||
Result := SendEnterExitLoop;
|
||||
finally
|
||||
Control.ControlState := Control.ControlState - [csFocusing];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user