mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 07:38:14 +02:00
lcl: call Application.OnDeactivate when widgetset interface asking LCL about this
git-svn-id: trunk@23884 -
This commit is contained in:
parent
82e7ef7f8f
commit
b2d37865b0
@ -1227,7 +1227,7 @@ type
|
||||
const Handler: TMethod);
|
||||
procedure RunLoop;
|
||||
procedure Activate;
|
||||
procedure Deactivate(Data: PtrInt = 0);
|
||||
procedure Deactivate(Force: Boolean = False);
|
||||
protected
|
||||
function GetConsoleApplication: boolean; override;
|
||||
procedure NotifyIdleHandler(var Done: Boolean);
|
||||
|
@ -1338,21 +1338,20 @@ end;
|
||||
procedure TApplication.Activate;
|
||||
begin
|
||||
if AppActive in FFlags then exit;
|
||||
Include(FFlags,AppActive);
|
||||
Include(FFlags, AppActive);
|
||||
NotifyActivateHandler;
|
||||
end;
|
||||
|
||||
procedure TApplication.Deactivate(Data: PtrInt);
|
||||
procedure TApplication.Deactivate(Force: Boolean = False);
|
||||
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;
|
||||
if (FindControl(GetFocus)<>nil) then begin
|
||||
// another control of this application has got the focus
|
||||
exit;
|
||||
// widgetset has passed deactivate or no control of this application has got the focus
|
||||
if Force or not Assigned(FindControl(GetFocus)) then
|
||||
begin
|
||||
Exclude(FFlags, AppActive);
|
||||
NotifyDeactivateHandler;
|
||||
end;
|
||||
Exclude(FFlags,AppActive);
|
||||
NotifyDeactivateHandler;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------}
|
||||
@ -1839,7 +1838,7 @@ end;
|
||||
|
||||
procedure TApplication.IntfAppDeactivate;
|
||||
begin
|
||||
Deactivate;
|
||||
Deactivate(True);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user