lcl: call Application.OnDeactivate when widgetset interface asking LCL about this

git-svn-id: trunk@23884 -
This commit is contained in:
paul 2010-03-09 08:13:30 +00:00
parent 82e7ef7f8f
commit b2d37865b0
2 changed files with 10 additions and 11 deletions

View File

@ -1227,7 +1227,7 @@ type
const Handler: TMethod); const Handler: TMethod);
procedure RunLoop; procedure RunLoop;
procedure Activate; procedure Activate;
procedure Deactivate(Data: PtrInt = 0); procedure Deactivate(Force: Boolean = False);
protected protected
function GetConsoleApplication: boolean; override; function GetConsoleApplication: boolean; override;
procedure NotifyIdleHandler(var Done: Boolean); procedure NotifyIdleHandler(var Done: Boolean);

View File

@ -1338,21 +1338,20 @@ end;
procedure TApplication.Activate; procedure TApplication.Activate;
begin begin
if AppActive in FFlags then exit; if AppActive in FFlags then exit;
Include(FFlags,AppActive); Include(FFlags, AppActive);
NotifyActivateHandler; NotifyActivateHandler;
end; end;
procedure TApplication.Deactivate(Data: PtrInt); procedure TApplication.Deactivate(Force: Boolean = False);
begin begin
if (AppDestroying in FFlags) then exit; if (AppDestroying in FFlags) or (not (AppActive in FFlags)) then Exit;
if (not (AppActive in FFlags)) then exit; // widgetset has passed deactivate or no control of this application has got the focus
if (FindControl(GetFocus)<>nil) then begin if Force or not Assigned(FindControl(GetFocus)) then
// another control of this application has got the focus begin
exit; Exclude(FFlags, AppActive);
NotifyDeactivateHandler;
end; end;
Exclude(FFlags,AppActive);
NotifyDeactivateHandler;
end; end;
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------}
@ -1839,7 +1838,7 @@ end;
procedure TApplication.IntfAppDeactivate; procedure TApplication.IntfAppDeactivate;
begin begin
Deactivate; Deactivate(True);
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------