add defocus action delay of 250ms

This commit is contained in:
April Ayres-Griffiths 2019-04-13 13:58:18 +10:00
parent 06a8af05fe
commit 5f0737c8d1
4 changed files with 11 additions and 3 deletions

View File

@ -586,6 +586,8 @@ procedure TGUIForm.AppDeactivate(Sender: TObject);
begin
// if we have deactivated because of a click on the main window
// then sort it...
lastFocusLostTime:=Now();
if MillisecondsBetween(Now(), lastShowTime) < 1000 then
exit;
@ -2290,8 +2292,8 @@ procedure TGUIForm.CheckTimerTimer(Sender: TObject);
begin
if isFS then
exit;
//if MilliSecondsBetween(Now(), lastShowTime) < 500 then
// exit;
if MilliSecondsBetween(Now(), lastFocusLostTime) < 250 then
exit;
if WindowState = wsMinimized then
exit;
//if hidden then

Binary file not shown.

Binary file not shown.

View File

@ -586,12 +586,18 @@ procedure TGUIForm.AppDeactivate(Sender: TObject);
begin
// if we have deactivated because of a click on the main window
// then sort it...
if MillisecondsBetween(Now(), lastShowTime) < 1000 then
exit;
RepaintWindow;
if GetTitleOfActiveWindow <> 'microM8' then
HideM8;
HideM8
else
begin
lastFocusLostTime:=Now();
StatusBar1.SimpleText:='focus';
end;
//StatusBar1.SimpleText := GetTitleOfActiveWindow;
//Memo1.Lines.Add('app is deactivating');
end;