From f86decdab154244a0b2716755f545834951878f2 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Mon, 6 Aug 2007 18:51:51 +0000 Subject: [PATCH] Fixed SD2-1325: SharpDevelop brought in front of running console app git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.1@2635 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Project/Src/Services/Debugger/DebuggerService.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs b/src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs index 2933ba74ab..7055acec34 100644 --- a/src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs +++ b/src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs @@ -101,14 +101,21 @@ namespace ICSharpCode.SharpDevelop.Debugging public static event EventHandler DebugStopped; static void OnDebugStarted(object sender, EventArgs e) + { + // OnDebugStarted runs on the main thread, but for some reason we + // have to delay the layout change a bit to work around SD2-1325 + WorkbenchSingleton.SafeThreadAsyncCall(OnDebugStartedInvoked); + if (DebugStarted != null) + DebugStarted(null, EventArgs.Empty); + } + + static void OnDebugStartedInvoked() { WorkbenchSingleton.Workbench.WorkbenchLayout.StoreConfiguration(); oldLayoutConfiguration = LayoutConfiguration.CurrentLayoutName; LayoutConfiguration.CurrentLayoutName = "Debug"; ClearDebugMessages(); - if (DebugStarted != null) - DebugStarted(null, e); } static void OnDebugStopped(object sender, EventArgs e)