mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 14:36:09 +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;
|
end;
|
||||||
|
|
||||||
finally
|
finally
|
||||||
OldActiveControl:=AForm.ActiveControl;
|
OldActiveControl:=AForm.LastActiveControl;
|
||||||
{$IF defined(VerboseAnchorDocking) or defined(VerboseAnchorDockRestore)}
|
{$IF defined(VerboseAnchorDocking) or defined(VerboseAnchorDockRestore)}
|
||||||
if not AForm.IsVisible then
|
if not AForm.IsVisible then
|
||||||
debugln(['TIDEAnchorDockMaster.ShowForm MakeVisible ',DbgSName(AForm),' ',dbgs(AForm.BoundsRect),' Floating=',DockMaster.IsFloating(AForm)]);
|
debugln(['TIDEAnchorDockMaster.ShowForm MakeVisible ',DbgSName(AForm),' ',dbgs(AForm.BoundsRect),' Floating=',DockMaster.IsFloating(AForm)]);
|
||||||
|
@ -461,6 +461,7 @@ type
|
|||||||
FKeyPreview: Boolean;
|
FKeyPreview: Boolean;
|
||||||
FMenu: TMainMenu;
|
FMenu: TMainMenu;
|
||||||
FModalResult: TModalResult;
|
FModalResult: TModalResult;
|
||||||
|
FLastActiveControl: TWinControl;
|
||||||
FLastFocusedControl: TWinControl;
|
FLastFocusedControl: TWinControl;
|
||||||
FOldBorderStyle: TFormBorderStyle;
|
FOldBorderStyle: TFormBorderStyle;
|
||||||
FOnActivate: TNotifyEvent;
|
FOnActivate: TNotifyEvent;
|
||||||
@ -701,6 +702,7 @@ type
|
|||||||
property Menu : TMainMenu read FMenu write SetMenu;
|
property Menu : TMainMenu read FMenu write SetMenu;
|
||||||
property ModalResult : TModalResult read FModalResult write SetModalResult;
|
property ModalResult : TModalResult read FModalResult write SetModalResult;
|
||||||
property Monitor: TMonitor read GetMonitor;
|
property Monitor: TMonitor read GetMonitor;
|
||||||
|
property LastActiveControl: TWinControl read FLastActiveControl;
|
||||||
property PopupMode: TPopupMode read FPopupMode write SetPopupMode default pmNone;
|
property PopupMode: TPopupMode read FPopupMode write SetPopupMode default pmNone;
|
||||||
property PopupParent: TCustomForm read FPopupParent write SetPopupParent;
|
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)]);
|
Debugln(['TCustomForm.SetActiveControl ',DbgSName(Self),' FActive=',DbgS(FActive),' OldActiveControl=',DbgSName(FActiveControl),' NewActiveControl=',DbgSName(AWinControl)]);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
FActiveControl := AWinControl;
|
FActiveControl := AWinControl;
|
||||||
|
if (FActiveControl<>nil) and (FActiveControl<>Self) and not (FActiveControl is TCustomForm) then
|
||||||
|
FLastActiveControl := FActiveControl;
|
||||||
if Assigned(FActiveControl) then FreeNotification(FActiveControl);
|
if Assigned(FActiveControl) then FreeNotification(FActiveControl);
|
||||||
if ([csLoading, csDestroying] * ComponentState = []) then
|
if ([csLoading, csDestroying] * ComponentState = []) then
|
||||||
begin
|
begin
|
||||||
@ -2478,6 +2480,8 @@ begin
|
|||||||
debugln(['TCustomForm.SetFocusedControl ',DbgSName(Self),' OldActiveControl=',DbgSName(FActiveControl),' New=',DbgSName(Control)]);
|
debugln(['TCustomForm.SetFocusedControl ',DbgSName(Self),' OldActiveControl=',DbgSName(FActiveControl),' New=',DbgSName(Control)]);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
FActiveControl := Control;
|
FActiveControl := Control;
|
||||||
|
if (FActiveControl<>nil) and not (FActiveControl is TCustomForm) then
|
||||||
|
FLastActiveControl := FActiveControl;
|
||||||
if Assigned(FActiveControl) then
|
if Assigned(FActiveControl) then
|
||||||
FreeNotification(FActiveControl);
|
FreeNotification(FActiveControl);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user