IDE: Hide IDE windows on "Run without Debugging" when the setting says so. Issue #39567.

This commit is contained in:
Juha 2022-01-17 12:12:05 +02:00
parent e210c73735
commit 9eaf4e3531

View File

@ -813,8 +813,8 @@ type
function DoRunProject: TModalResult; override;
function DoRunProjectWithoutDebug: TModalResult; override;
function DoSaveProjectToTestDirectory(Flags: TSaveFlags): TModalResult;
procedure RunFinished(Sender: TObject);
function QuitIDE: boolean;
// edit menu
procedure DoCommand(ACommand: integer); override;
procedure DoSourceEditorCommand(EditorCommand: integer;
@ -7389,8 +7389,11 @@ begin
Exit(mrNone);
end;
AddHandlerOnRunFinished(@RunFinished);
Project1.RunParameterOptions.AssignEnvironmentTo(Process.Environment);
try
if EnvironmentOptions.Desktop.HideIDEOnRun then
HideIDE;
TNotifyProcessEnd.Create(Process, @DoCallRunFinishedHandler);
Process:=nil; // Process is freed by TNotifyProcessEnd
except
@ -7403,6 +7406,12 @@ begin
end;
end;
procedure TMainIDE.RunFinished(Sender: TObject);
begin
if EnvironmentOptions.Desktop.HideIDEOnRun then
UnhideIDE;
end;
procedure TMainIDE.DoRestart;
{$ifdef darwin}