From 7ca1de42c0687f4cbd08f881ce2da9cd7cab80c1 Mon Sep 17 00:00:00 2001 From: Matt Parker <61717342+MattParkerDev@users.noreply.github.com> Date: Sun, 18 Jan 2026 17:16:51 +1000 Subject: [PATCH] run panel appears after build --- .../Features/BottomPanel/BottomPanelManager.cs | 6 ++++++ src/SharpIDE.Godot/Features/Run/RunMenuItem.cs | 2 -- .../SolutionExplorer/ContextMenus/ProjectContextMenu.cs | 2 -- src/SharpIDE.Godot/IdeRoot.cs | 1 - 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/SharpIDE.Godot/Features/BottomPanel/BottomPanelManager.cs b/src/SharpIDE.Godot/Features/BottomPanel/BottomPanelManager.cs index d195205..c90dac2 100644 --- a/src/SharpIDE.Godot/Features/BottomPanel/BottomPanelManager.cs +++ b/src/SharpIDE.Godot/Features/BottomPanel/BottomPanelManager.cs @@ -1,4 +1,5 @@ using Godot; +using SharpIDE.Application.Features.Events; using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence; using SharpIDE.Godot.Features.Build; using SharpIDE.Godot.Features.Debug_; @@ -44,8 +45,13 @@ public partial class BottomPanelManager : Panel }; GodotGlobalEvents.Instance.BottomPanelTabSelected.Subscribe(OnBottomPanelTabSelected); + GlobalEvents.Instance.ProjectStartedRunning.Subscribe(OnProjectStartedRunning); + GlobalEvents.Instance.ProjectStartedDebugging.Subscribe(OnProjectStartedDebugging); } + private async Task OnProjectStartedRunning(SharpIdeProjectModel _) => GodotGlobalEvents.Instance.BottomPanelTabExternallySelected.InvokeParallelFireAndForget(BottomPanelType.Run); + private async Task OnProjectStartedDebugging(SharpIdeProjectModel arg) => GodotGlobalEvents.Instance.BottomPanelTabExternallySelected.InvokeParallelFireAndForget(BottomPanelType.Debug); + public override void _ExitTree() { GodotGlobalEvents.Instance.BottomPanelTabSelected.Subscribe(OnBottomPanelTabSelected); diff --git a/src/SharpIDE.Godot/Features/Run/RunMenuItem.cs b/src/SharpIDE.Godot/Features/Run/RunMenuItem.cs index f8805e8..cd328d7 100644 --- a/src/SharpIDE.Godot/Features/Run/RunMenuItem.cs +++ b/src/SharpIDE.Godot/Features/Run/RunMenuItem.cs @@ -55,13 +55,11 @@ public partial class RunMenuItem : HBoxContainer private async void OnRunButtonPressed() { - GodotGlobalEvents.Instance.BottomPanelTabExternallySelected.InvokeParallelFireAndForget(BottomPanelType.Run); await _runService.RunProject(Project).ConfigureAwait(false); } private async void OnDebugButtonPressed() { - GodotGlobalEvents.Instance.BottomPanelTabExternallySelected.InvokeParallelFireAndForget(BottomPanelType.Debug); var debuggerExecutableInfo = new DebuggerExecutableInfo { UseInMemorySharpDbg = Singletons.AppState.IdeSettings.DebuggerUseSharpDbg, diff --git a/src/SharpIDE.Godot/Features/SolutionExplorer/ContextMenus/ProjectContextMenu.cs b/src/SharpIDE.Godot/Features/SolutionExplorer/ContextMenus/ProjectContextMenu.cs index 30f7113..9931960 100644 --- a/src/SharpIDE.Godot/Features/SolutionExplorer/ContextMenus/ProjectContextMenu.cs +++ b/src/SharpIDE.Godot/Features/SolutionExplorer/ContextMenus/ProjectContextMenu.cs @@ -62,7 +62,6 @@ public partial class SolutionExplorerPanel { _ = Task.GodotRun(async () => { - GodotGlobalEvents.Instance.BottomPanelTabExternallySelected.InvokeParallelFireAndForget(BottomPanelType.Run); await _runService.RunProject(project); }); } @@ -98,7 +97,6 @@ public partial class SolutionExplorerPanel } private async Task MsBuildProject(SharpIdeProjectModel project, BuildType buildType) { - GodotGlobalEvents.Instance.BottomPanelTabExternallySelected.InvokeParallelFireAndForget(BottomPanelType.Build); await _buildService.MsBuildAsync(project.FilePath, buildType); } } diff --git a/src/SharpIDE.Godot/IdeRoot.cs b/src/SharpIDE.Godot/IdeRoot.cs index f90b8a6..2571c7d 100644 --- a/src/SharpIDE.Godot/IdeRoot.cs +++ b/src/SharpIDE.Godot/IdeRoot.cs @@ -137,7 +137,6 @@ public partial class IdeRoot : Control private async void MsBuild(BuildType buildType) { await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding); - GodotGlobalEvents.Instance.BottomPanelTabExternallySelected.InvokeParallelFireAndForget(BottomPanelType.Build); await _buildService.MsBuildAsync(_solutionExplorerPanel.SolutionModel.FilePath, buildType); }