mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 04:29:25 +02:00
LCL: Improve giving focus to docked windows from Windows menu. Issue #32659, patch from Pascal Riekenberg.
git-svn-id: trunk@56417 -
This commit is contained in:
parent
4111fd882a
commit
93f48e1da6
@ -372,7 +372,7 @@ begin
|
||||
end;
|
||||
|
||||
finally
|
||||
OldActiveControl:=AForm.ActiveControl;
|
||||
OldActiveControl:=AForm.LastActiveControl;
|
||||
{$IF defined(VerboseAnchorDocking) or defined(VerboseAnchorDockRestore)}
|
||||
if not AForm.IsVisible then
|
||||
debugln(['TIDEAnchorDockMaster.ShowForm MakeVisible ',DbgSName(AForm),' ',dbgs(AForm.BoundsRect),' Floating=',DockMaster.IsFloating(AForm)]);
|
||||
|
@ -461,6 +461,7 @@ type
|
||||
FKeyPreview: Boolean;
|
||||
FMenu: TMainMenu;
|
||||
FModalResult: TModalResult;
|
||||
FLastActiveControl: TWinControl;
|
||||
FLastFocusedControl: TWinControl;
|
||||
FOldBorderStyle: TFormBorderStyle;
|
||||
FOnActivate: TNotifyEvent;
|
||||
@ -701,6 +702,7 @@ type
|
||||
property Menu : TMainMenu read FMenu write SetMenu;
|
||||
property ModalResult : TModalResult read FModalResult write SetModalResult;
|
||||
property Monitor: TMonitor read GetMonitor;
|
||||
property LastActiveControl: TWinControl read FLastActiveControl;
|
||||
property PopupMode: TPopupMode read FPopupMode write SetPopupMode default pmNone;
|
||||
property PopupParent: TCustomForm read FPopupParent write SetPopupParent;
|
||||
|
||||
|
@ -1911,6 +1911,8 @@ begin
|
||||
Debugln(['TCustomForm.SetActiveControl ',DbgSName(Self),' FActive=',DbgS(FActive),' OldActiveControl=',DbgSName(FActiveControl),' NewActiveControl=',DbgSName(AWinControl)]);
|
||||
{$ENDIF}
|
||||
FActiveControl := AWinControl;
|
||||
if (FActiveControl<>nil) and (FActiveControl<>Self) and not (FActiveControl is TCustomForm) then
|
||||
FLastActiveControl := FActiveControl;
|
||||
if Assigned(FActiveControl) then FreeNotification(FActiveControl);
|
||||
if ([csLoading, csDestroying] * ComponentState = []) then
|
||||
begin
|
||||
@ -2478,6 +2480,8 @@ begin
|
||||
debugln(['TCustomForm.SetFocusedControl ',DbgSName(Self),' OldActiveControl=',DbgSName(FActiveControl),' New=',DbgSName(Control)]);
|
||||
{$ENDIF}
|
||||
FActiveControl := Control;
|
||||
if (FActiveControl<>nil) and not (FActiveControl is TCustomForm) then
|
||||
FLastActiveControl := FActiveControl;
|
||||
if Assigned(FActiveControl) then
|
||||
FreeNotification(FActiveControl);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user