浏览代码

Swap order in BringToFrontAndRestore support function to work around VCL bug.

If Application.BringToFront is called while the app is minimized, the Forms unit's WM_ACTIVATEAPP handler inexplicably sets FAppIconic=False, which causes the next Application.Restore call to be a no-op.

Jordan Russell 8 月之前
父节点
当前提交
f6f2f17381
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      Projects/Src/Setup.ScriptFunc.pas

+ 2 - 1
Projects/Src/Setup.ScriptFunc.pas

@@ -1587,8 +1587,9 @@ var
   begin
   begin
     RegisterScriptFunc('BRINGTOFRONTANDRESTORE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('BRINGTOFRONTANDRESTORE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin
-      Application.BringToFront;
+      { Must be in this order to work around VCL bug }
       Application.Restore;
       Application.Restore;
+      Application.BringToFront;
     end);
     end);
     RegisterScriptFunc('WizardDirValue', sfNoUninstall, procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('WizardDirValue', sfNoUninstall, procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin