Cocoa: Disable activation loop if NSWindow is not activatable

git-svn-id: trunk@44072 -
This commit is contained in:
freq 2014-02-14 14:24:00 +00:00
parent a672e20451
commit d44ca788c7

View File

@ -35,7 +35,10 @@ type
{ TLCLWindowCallback }
TLCLWindowCallback = class(TLCLCommonCallBack, IWindowCallback)
private
IsActivating: boolean;
public
constructor Create(AOwner: NSObject; ATarget: TWinControl); override;
function CanActivate: Boolean; virtual;
procedure Activate; virtual;
procedure Deactivate; virtual;
@ -247,10 +250,19 @@ begin
Result := Enabled;
end;
constructor TLCLWindowCallback.Create(AOwner: NSObject; ATarget: TWinControl);
begin
inherited;
IsActivating:=false;
end;
procedure TLCLWindowCallback.Activate;
var
ACustForm: TCustomForm;
begin
if not IsActivating then
begin
IsActivating:=True;
ACustForm := Target as TCustomForm;
if (ACustForm.Menu <> nil) and
@ -268,8 +280,11 @@ begin
end
else
CocoaWidgetSet.SetMainMenu(0);
LCLSendActivateMsg(Target, WA_ACTIVE, false);
LCLSendSetFocusMsg(Target);
IsActivating:=False;
end;
end;
procedure TLCLWindowCallback.Deactivate;