mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-07 03:27:12 +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);
|
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);
|
||||||
|
@ -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;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user