LCL: added flag EnableAsyncDeactivate for possible workaround for too early/many deactivate events

git-svn-id: trunk@21188 -
This commit is contained in:
mattias 2009-08-12 11:38:37 +00:00
parent 236c316138
commit d4eeeafe50
2 changed files with 6 additions and 1 deletions

View File

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

View File

@ -463,9 +463,14 @@ end;
procedure TCustomForm.WMDeactivate(var Message : TLMActivate);
begin
FActive:=false;
{$IFDEF EnableAsyncDeactivate}
Deactivate;
if Application<>nil then
Application.QueueAsyncCall(@Application.Deactivate,0);
{$ELSE}
if Application<>nil then Application.Deactivate;
Deactivate;
{$ENDIF}
end;
procedure TCustomForm.CMShowingChanged(var Message: TLMessage);